Part Number Hot Search : 
1N4148TA MIC24045 2SC5886 UPD78 B1117 A4408 ML6672CQ FOA9400
Product Description
Full Text Search
 

To Download DSPIC33EP16GS202 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2015-2016 microchip technology inc. ds70005208d-page 1 dspic33epxxgs202 family operating conditions 3.0v to 3.6v, -40c to +85c, dc to 70 mips 3.0v to 3.6v, -40c to +125c, dc to 60 mips flash architecture 16 kbytes-32 kbytes of program flash core: 16-bit dspic33e cpu code-efficient (c and assembly) architecture two 40-bit wide accumulators single-cycle (mac/mpy) with dual data fetch single-cycle mixed-sign mul plus hardware divide 32-bit multiply support two additional working register sets (reduces context switching) clock management 0.9% internal oscillator programmable plls and oscillator clock sources fail-safe clock monitor (fscm) independent watchdog timer (wdt) fast wake-up and start-up power management low-power management modes (sleep, idle, doze) integrated power-on reset and brown-out reset 0.5 ma/mhz dynamic current (typical) 10 a i pd current (typical) high-speed pwm three pwm generators (two outputs per generator) individual time base and duty cycle for each pwm 1.04 ns pwm resolution (frequency, duty cycle, dead time and phase) supports center-aligned, redundant, complementary and true independent output modes independent fault and current-limit inputs output override control pwm support for: - ac/dc, dc/dc, inverters, pfc, lighting advanced analog features high-speed adc module: - 12-bit with 2 dedicated sar adc cores and one shared sar adc core - up to 3.25 msps conversion rate per adc core @ 12-bit resolution - dedicated result buffer for each analog channel - flexible and independent adc trigger sources - two digital comparators - one oversampling filter two rail-to-rail comparators with hysteresis: - dedicated 12-bit digital-to-analog converter (dac) for each analog comparator two programmable gain amplifiers: - single-ended or independent ground reference - five selectable gains (4x, 8x, 16x, 32x and 64x) - 40 mhz gain bandwidth interconnected smps peripherals reduces cpu interaction to improve performance flexible pwm trigger options for adc conversions high-speed comparator truncates pwm (15 ns typical): - supports cycle-by-cycle current mode control - current reset mode (variable frequency) timers/output compare/input capture three 16-bit and up to two 32-bit timers/ counters one output compare (oc) module, configurable as timers/counters one input capture (ic) module 16-bit digi tal signal controllers for digi tal power applications with interconne cted high-speed pwm, adc, pga and comparators downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 2 ? 2015-2016 microchip technology inc. communication interfaces one uart module (15 mbps): - supports lin/j2602 protocols and irda ? one 4-wire spi module (15 mbps) one i 2 c module (up to 1 mbaud) with smbus support input/output sink/source up to 12ma/15ma, respectively; pin-specific for standard v oh /v ol 5v tolerant pins selectable open-drain, pull-ups and pull-downs external interrupts on all i/o pins peripheral pin select (pps) to allow function remap with six virtual i/os qualification and class b support aec-q100 revg (grade 1, -40c to +125c) class b safety library, iec 60730 4x4x0.6 mm and 6x6x0.5 mm uqfn packages are designed and optimized to ease ipc9592b 2nd level temperature cycle qualification debugger development support in-circuit and in-application programming three program and one complex data breakpoint ieee 1149.2 compatible (jtag) boundary scan trace and run-time watch table 1: dspic33epxxgs202 family devices device pins program memory bytes ram bytes timers ( 1 ) remappable peripherals pwm adc inputs i 2 c adc cores pga analog comparator general purpose i/o (gpio) packages input capture output compare uart spi external interrupts ( 2 ) DSPIC33EP16GS202 28 16k 2k 3 1 1 1 1 3 3x2 12 1 3 2 2 21 ssop, soic, qfn-s, uqfn (4x4 mm), uqfn (6x6 mm) dspic33ep32gs202 28 32k 2k 3 1 1 1 1 3 3x2 12 1 3 2 2 21 note 1: the external clock for timer1, timer2 and timer3 is remappable. 2: int0 is not remappable; int1 and int2 are remappable. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 3 dspic33epxxgs202 family pin diagrams 28-pin soic, mclr av dd ra0 av ss ra1 ra3 ra2 ra4 rb0 rb14 rb9 rb13 rb10 rb12 rb11 rb1 v cap rb2 v ss rb3 rb7 rb4 rb6 v dd rb5 rb8 rb15 = pins are up to 5v tolerant v ss dspic33epxxgs202 12 3 4 5 6 7 8 9 10 11 12 13 14 2827 26 25 24 23 22 21 20 19 18 17 16 15 legend: shaded pins are up to 5 vdc tolerant. note: rpn represents remappable peripheral functions. see table 10-1 and table 10-2 for the complete list of remappable sources. 28-pin ssop pin function descriptions pin pin function pin pin function 1mclr 15 pgec3/ rp47 /rb15 2 an0/pga1p1/cmp1a/ra0 16 tdo/an9/pga2n2/ rp37 /rb5 3 an1/pga1p2/pga2p1/cmp1b/ra1 17 pged1/tdi/an10/scl1/ rp38 /rb6 4 an2/pga1p3/pga2p2/cmp1c/cmp2a/ra2 18 pgec1/an11/sda1/ rp39 /rb7 5 an3/pga2p3/cmp1d/cmp2b/ rp32 /rb0 19 v ss 6an4/cmp2c/ rp41 /rb9 20 v cap 7an5/cmp2d/ rp42 /rb10 21 tms/pwm3h/ rp43 /rb11 8v ss 22 tck/pwm3l/ rp44 /rb12 9 osc1/clki/an6/ rp33 /rb1 23 pwm2h/ rp45 /rb13 10 osc2/clko/an7/pga1n2/ rp34 /rb2 24 pwm2l/ rp46 /rb14 11 pged2/an8/int0/ rp35 /rb3 25 pwm1h/ra4 12 pgec2/adtrg31/ rp36 /rb4 26 pwm1l/ra3 13 v dd 27 av ss 14 pged3/ rp40 /rb8 28 av dd downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 4 ? 2015-2016 microchip technology inc. pin diagrams (continued) 21 20 19 18 17 16 15 1 2 3 4 5 6 7 24 11 10 9 8 25 26 28 22 13 12 27 14 dspic33epxxgs202 rb6 rb5 rb15 rb8 v dd rb4 rb3 rb14 rb13 rb12 rb11 v cap v ss rb7 ra4 ra3 av ss av dd mclr ra0 ra1 ra2rb0 v ss rb1rb2 rb9 rb10 = pins are up to 5v tolerant 28-pin uqfn 4x4 mm, 28-pin uqfn 6x6 mm, 28-pin qfn-s 6x6 mm 23 pin function descriptions pin pin function pin pin function 1 an2/pga1p3/pga2p2/cmp1c/cmp2a/ra2 15 pgec1/an11/sda1/ rp39 /rb7 2 an3/pga2p3/cmp1d/ cmp28/ rp32 /rb0 16 v ss 3an4/cmp2c/ rp41 /rb9 17 v cap 4an5/cmp2d/ rp42 /rb10 18 tms/pwm3h/ rp43 /rb11 5v ss 19 tck/pwm3l/ rp44 /rb12 6 osc1/clki/an6/ rp33 /rb1 20 pwm2h/ rp45 /rb13 7 osc2/clko/an7/pga1n2/ rp34 /rb2 21 pwm2l/ rp46 /rb14 8 pged2/an8/int0/ rp35 /rb3 22 pwm1h/ra4 9 pgec2/adtrg31/ rp36 /rb4 23 pwm1l/ra3 10 v dd 24 av ss 11 pged3/ rp40 /rb8 25 av dd 12 pgec3/ rp47 /rb15 26 mclr 13 tdo/an9/pga2n2/ rp37 /rb5 27 an0/pga1p1/cmp1a/ra0 14 pged1/tdi/an10/scl1/ rp38 /rb6 28 an1/pga1p2/pga2p1/cmp1b/ra1 legend: shaded pins are up to 5 vdc tolerant. note: rpn represents remappable peripheral functions. see table 10-1 and table 10-2 for the complete list of remappable sources. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 5 dspic33epxxgs202 family table of contents 1.0 device overview ............................................................................ .............................................................................................. 7 2.0 guidelines for getting started with 16-bit digital signal cont rollers....................................................... ................................... 11 3.0 cpu.............................................................................................. .............................................................................................. 17 4.0 memory organization .......................................... ................................................... ............ ........................................................ 27 5.0 flash program memory.............................................................. .......................................... ...................................................... 61 6.0 resets ......................................................................................... ............................ .................................................................. 69 7.0 interrupt controller ................................................ ........................................................ ............................................................. 73 8.0 oscillator configuration ..................................... ........................................................................................................... .............. 87 9.0 power-saving features............................................................ ........................................... ....................................................... 99 10.0 i/o ports ....................................................................................... ........................... ................................................................. 107 11.0 timer1 .......................................................................................... ............................................................................................ 133 12.0 timer2/3 ........................................................................................ .......................... ................................................................ 137 13.0 input capture............................................ ................................................... ............... .............................................................. 141 14.0 output compare........................................................................... .................................. .......................................................... 145 15.0 high-speed pwm........................................................................... .................................. ........................................................ 151 16.0 serial peripheral interface (spi)........................................ .................................................. ..................................................... 177 17.0 inter-integrated circuit (i 2 c) ....................................................................................................... .............................................. 185 18.0 universal asynchronous receiver transmitter (uart) ............................... .......................................... .................................. 193 19.0 high-speed, 12-bit analog-to-digital converter (adc)... .................................................................... ..................................... 199 20.0 high-speed analog comparator .................................................... ........................................... ............................................... 229 21.0 programmable gain amplifier (pga) ................................................... ....................................... ............................................. 235 22.0 special features ................................................... ........................................................ ........................................................... 239 23.0 instruction set summary ........................................................ ............................................ ...................................................... 251 24.0 development support............................................ ................................................... ......... ....................................................... 261 25.0 electrical characteristics ...................................................... ........................................... ......................................................... 265 26.0 dc and ac device characteristics graphs.................................. .................................................. .......................................... 311 27.0 packaging information.............................................................. ........................................ ........................................................ 315 appendix a: revision history.......................................... ................................................... ...... .......................................................... 331 index ................................................. ................................................... ...................... ....................................................................... 333 the microchip web site........................................................................... .............................. ............................................................ 339 customer change notification service ....................................... ................................................... . ................................................... 339 customer support............................................... ................................................... ............. ............................................................... 339 product identification system ............................................. ..................................................... .......................................................... 341 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 6 ? 2015-2016 microchip technology inc. to our valued customers it is our intention to provide our valued customers with the best documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publications to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments regar ding this publication, please contact the marketing communications department via e-mail at docerrors@microchip.com . we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data s heet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the versi on number, (e.g., ds30000000a is ve rsion a of document ds30000000). errata an errata sheet, describing minor operational differences fr om the data sheet and recommended workarounds, may exist for curren t devices. as device/documentation issues become known to us, we will publish an errata sheet. the errata will specify the rev isi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a particul ar device, please check with one of the following: microchips worldwide web site; http://www.microchip.com your local microchip sales office (see last page) when contacting a sales office, please spec ify which device, revision of silicon and data sheet (include literature number) you are using. customer notification system register on our web site at www.microchip.com to receive the most current information on all of our products. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 7 dspic33epxxgs202 family 1.0 device overview this document contains device-specific information for the dspic33epxxgs202 digital signal controller (dsc) devices. the dspic33epxxgs202 devices contain extensive digital signal processor (dsp) functionality with a high-performance, 16-bit mcu architecture. figure 1-1 shows a general block diagram of the core and peripheral modules. table 1-1 lists the functions of the various pins shown in the pinout diagrams. figure 1-1: dspic33epxxgs202 family block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a com- prehensive resource. to complement the information in this data sheet, refer to the related section in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. porta power-up timer oscillator start-up osc1/clki mclr v dd , v ss uart1 timing generation i2c1 adc timers input capture 1 output compare 1 av dd , av ss spi1 watchdog timer por/bor pwm remappable pins pga1, pga2 cpu refer to figure 3-1 for cpu diagram details. 16 16 portb ports peripheral modules timer analog comparator 1-2 3x2 1-3 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 8 ? 2015-2016 microchip technology inc. table 1-1: pinout i/o descriptions pin name pin type buffer type pps description an0-an11 i analog no analog input channels. clki clko i o st/ cmos nono external clock source input. always associated with osc1 pin function. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. always associated with osc2 pin function. osc1osc2 i i/o st/ cmos nono oscillator crystal input. st buffer when configured in rc mode; cmos otherwise. oscillator crystal output. connects to crystal or resonator in crystal oscillator mode. optionally functions as clko in rc and ec modes. ic1 i st yes capture input 1. ocfa oc1 i o st yes yes compare fault a input (for compare channels). compare output 1. int0 int1 int2 ii i stst st no yes yes external interrupt 0. external interrupt 1. external interrupt 2. ra0-ra4 i/o st no porta is a bidirectional i/o port. rb0-rb15 i/o st no portb is a bidirectional i/o port. t1ck t2ck t3ck ii i stst st yes yes yes timer1 external clock input. timer2 external clock input. timer3 external clock input. u1cts u1rts u1rx u1tx bclk1 i o i oo st st st yes yes yes yes yes uart1 clear-to-send. uart1 request-to-send. uart1 receive. uart1 transmit. uart1 irda ? baud clock output. sck1 sdi1 sdo1 ss1 i/o i o i/o stst st yes yes yes yes synchronous serial clock input/output for spi1. spi1 data in. spi1 data out. spi1 slave synchronization or frame pulse i/o. scl1 sda1 i/oi/o stst nono synchronous serial clock input/output for i2c1. synchronous serial data input/output for i2c1. tms tck tdi tdo ii i o stst st nono no no jtag test mode select pin. jtag test clock input pin. jtag test data input pin. jtag test data output pin. flt1-flt8 pwm1l-pwm3l pwm1h-pwm3h synci1, synci2 synco1, synco2 i oo i o st st yes nono yes yes pwm fault inputs 1 through 8. pwm low outputs 1 through 3. pwm high outputs 1 through 3. pwm synchronization inputs 1 and 2. pwm synchronization outputs 1 and 2. cmp1a-cmp2a cmp1b-cmp2b cmp1c-cmp2c cmp1d-cmp2d ii i i analog analog analog analog nono no no comparator channels 1a through 2a inputs. comparator channels 1b through 2b inputs. comparator channels 1c through 2c inputs. comparator channels 1d through 2d inputs. legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 9 dspic33epxxgs202 family pga1p1-pga1p3 i analog no pga1 positive inputs 1 through 3. pga1n2 i analog no pga1 negative input 2. pga2p1-pga2p3 i analog no pga2 positive inputs 1 through 3. pga2n2 i analog no pga2 negative input 2. adtrg31 i st no external adc trigger source. pged1 pgec1 pged2 pgec2 pged3 pgec3 i/o i i/o i i/o i stst st st st st nono no no no no data i/o pin for programming/debugging communication channel 1. clock input pin for programming/debugging communication channel 1. data i/o pin for programming/debugging communication channel 2. clock input pin for programming/debugging communication channel 2. data i/o pin for programming/debugging communication channel 3. clock input pin for programming/debugging communication channel 3. mclr i/p st no master clear (reset) input. this pin is an active-low reset to the device. av dd p p no positive supply for analog modules. this pin must be connected at all times. av ss p p no ground reference for analog modules. this pin must be connected at all times. v dd p no positive supply for peripheral logic and i/o pins. v cap p no cpu logic filter capacitor connection. v ss p no ground reference for logic and i/o pins. table 1-1: pinout i/o descriptions (continued) pin name pin type buffer type pps description legend: cmos = cmos compatible input or output analog = analog input p = power st = schmitt trigger input with cmos levels o = output i = input pps = peripheral pin select ttl = ttl input buffer downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 10 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 11 dspic33epxxgs202 family 2.0 guidelines for getting started with 16-bit digital signal controllers 2.1 basic connection requirements getting started with the dspic33epxxgs202 family requires attention to a minimal set of device pin connections before proceeding with development. the following is a list of pin names which must always be connected: all v dd and v ss pins (see section 2.2 ?decoupling capacitors? ) all av dd and av ss pins regardless if adc module is not used (see section 2.2 ?decoupling capacitors? ) v cap (see section 2.3 ?cpu logic filter capacitor connection (v cap )? ) mclr pin (see section 2.4 ?master clear (mclr) pin? ) pgecx/pgedx pins used for in-circuit serial programming? (icsp?) and debugging purposes (see section 2.5 ?icsp pins? ) osc1 and osc2 pins when external oscillator source is used (see section 2.6 ?external oscillator pins? ) 2.2 decoupling capacitors the use of decoupling capacitors on every pair of power supply pins, such as v dd , v ss , av dd and av ss is required. consider the following criteria when using decoupling capacitors: value and type of capacitor: recommendation of 0.1 f (100 nf), 10-20v. this capacitor should be a low-esr and have resonance frequency in the range of 20 mhz and higher. it is recommended to use ceramic capacitors. placement on the printed circuit board: the decoupling capacitors should be placed as close to the pins as possible. it is recommended to place the capacitors on the same side of the board as the device. if space is constricted, the capacitor can be placed on another layer on the pcb using a via; however, ensure that the trace length from the pin to the capacitor is within one-quarter inch (6 mm) in length. handling high-frequency noise: if the board is experiencing high-frequency noise, above tens of mhz, add a second ceramic-type capacitor in parallel to the above described decoupling capacitor. the value of the second capacitor can be in the range of 0.01 f to 0.001 f. place this second capacitor next to the primary decoupling capacitor. in high-speed circuit designs, consider implementing a decade pair of capacitances as close to the power and ground pins as possible. for example, 0.1 f in parallel with 0.001 f. maximizing performance: on the board layout from the power supply circuit, run the power and return traces to the decoupling capacitors first, and then to the device pins. this ensures that the decoupling capacitors are first in the power chain. equally important is to keep the trace length between the capacitor and the power pins to a minimum, thereby reducing pcb track inductance. note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 12 ? 2015-2016 microchip technology inc. figure 2-1: recommended minimum connection 2.2.1 tank capacitors on boards with power traces running longer than six inches in length, it is suggested to use a tank capacitor for integrated circuits including dscs to supply a local power source. the value of the tank capacitor should be determined based on the trace resistance that con- nects the power supply source to the device and the maximum current drawn by the device in the applica- tion. in other words, select the tank capacitor so that it meets the acceptable voltage sag at the device. typical values range from 4.7 f to 47 f. 2.3 cpu logic filter capacitor connection (v cap ) a low-esr (<1 ohms) capacitor is required on the v cap pin, which is used to stabilize the voltage regulator output voltage. the v cap pin must not be connected to v dd and must have a capacitor greater than 4.7 f (10 f is recommended), 16v connected to ground. the type can be ceramic or tantalum. see section 25.0 ?electrical characteristics? for additional information. the placement of this capacitor should be close to the v cap pin. it is recommended that the trace length not exceeds one-quarter inch (6 mm). see section 22.4 ?on-chip voltage regulator? for details. 2.4 master clear (mclr ) pin the mclr pin provides two specific device functions: device reset device programming and debugging. during device programming and debugging, the resistance and capacitance that can be added to the pin must be considered. device programmers and debuggers drive the mclr pin. consequently, specific voltage levels (v ih and v il ) and fast signal transitions must not be adversely affected. therefore, specific values of r and c will need to be adjusted based on the application and pcb requirements. for example, as shown in figure 2-2 , it is recommended that the capacitor, c, be isolated from the mclr pin during programming and debugging operations. place the components as shown in figure 2-2 within one-quarter inch (6 mm) from the mclr pin. figure 2-2: example of mclr pin connections note 1: as an option, instead of a hard-wired connection, an inductor (l1) can be substituted between v dd and av dd to improve adc noise rejection. the inductor impedance should be less than 1 ? and the inductor capacity greater than 10 ma. where: f f cnv 2 ------------- - = f 1 2 ? lc ?? ----------------------- = l 1 2 ? fc ?? --------------------- - ?? ?? 2 = (i.e., a/d conversion rate/2) dspic33epxxgs202 v dd v ss v dd v ss v ss v dd av dd av ss v dd v ss 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic 0.1 f ceramic c r v dd mclr 0.1 f ceramic v cap l1 (1) r1 10 f tantalum c r1 (2) r (1) v dd mclr dspic33epxxgs202 jp note 1: r ? 10 k ? is recommended. a suggested starting value is 10 k ? . ensure that the mclr pin v ih and v il specifications are met. 2: r1 ? 470 ? will limit any current flowing into mclr from the external capacitor, c, in the event of mclr pin breakdown due to electrostatic discharge (esd) or electrical overstress (eos). ensure that the mclr pin v ih and v il specifications are met. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 13 dspic33epxxgs202 family 2.5 icsp pins the pgecx and pgedx pins are used for icsp and debugging purposes. it is recommended to keep the trace length between the icsp connector and the icsp pins on the device as short as possible. if the icsp con- nector is expected to experience an esd event, a series resistor is recommended, with the value in the range of a few tens of ohms, not to exceed 100 ohms. pull-up resistors, series diodes and capacitors on the pgecx and pgedx pins are not recommended as they will interfere with the programmer/debugger communi- cations to the device. if such discrete components are an application requirement, they should be removed from the circuit during programming and debugging. alternatively, refer to the ac/dc characteristics and timing requirements information in the respective device flash programming specification for information on capacitive loading limits and pin voltage input high (v ih ) and voltage input low (v il ) requirements. ensure that the communication channel select (i.e., pgecx/pgedx pins) programmed into the device matches the physical connections for the icsp to mplab ? pickit? 3, mplab icd 3 or mplab real ice?. for more information on mplab icd 2, mplab icd 3 and real ice connection requirements, refer to the following documents that are available on the microchip web site. ?using mplab ? icd 3? (poster) ds51765 ?multi-tool design advisory? ds51764 ?mplab ? real ice? in-circuit emulator user?s guide? ds51616 ?using mplab ? real ice? in-circuit emulator? (poster) ds51749 2.6 external oscillator pins many dscs have options for at least two oscillators: a high-frequency primary oscillator and a low-frequency secondary oscillator. for details, see section 8.0 ?oscillator configuration? for details. the oscillator circuit should be placed on the same side of the board as the device. also, place the oscil- lator circuit close to the respective oscillator pins, not exceeding one-half inch (12 mm) distance between them. the load capacitors should be placed next to the oscillator itself, on the same side of the board. use a grounded copper pour around the oscillator circuit to isolate them from surrounding circuits. the grounded copper pour should be routed directly to the mcu ground. do not run any signal traces or power traces inside the ground pour. also, if using a two-sided board, avoid any traces on the other side of the board where the crystal is placed. a suggested layout is shown in figure 2-3 . figure 2-3: suggested placement of the oscillator circuit main oscillator guard ring guard trace oscillator pins downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 14 ? 2015-2016 microchip technology inc. 2.7 oscillator value conditions on device start-up if the pll of the target device is enabled and configured for the device start-up oscillator, the maximum oscillator source frequency must be limited to 3 mhz < f in < 5.5 mhz to comply with device pll start-up conditions. this means that if the external oscillator frequency is outside this range, the application must start-up in the frc mode first. the default pll settings after a por with an oscillator frequency outside this range will violate the device operating speed. once the device powers up, the application firmware can initialize the pll sfrs, clkdiv and plldbf to a suitable value, and then perform a clock switch to the oscillator + pll clock source. note that clock switching must be enabled in the device configuration word. 2.8 unused i/os unused i/o pins should be configured as outputs and driven to a logic-low state. alternatively, connect a 1k to 10k resistor between v ss and unused pins and drive the output to logic low. 2.9 targeted applications power factor correction (pfc) - interleaved pfc - critical conduction pfc - bridgeless pfc dc/dc converters - buck, boost, forward, flyback, push-pull - half/full-bridge - phase-shift full-bridge - resonant converters dc/ac - half/full-bridge inverter - resonant inverter examples of typical application connections are shown in figure 2-4 through figure 2-6 . figure 2-4: interleaved pfc v ac v out + pga/adc channel pwm adc pwm |v ac | k 4 k 3 dspic33epxxgs202 v out - adc channel pga/adc k 1 channel channel pga/adc channel k 2 fet driver k 5 fet driver note: k 1 , k 2 and k 3 are gains. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 15 dspic33epxxgs202 family figure 2-5: phase-shifte d full-bridge converter v in + v in - s1 g ate 4 gate 2 gate 3 gate 1 analog ground v out + v out - k 2 fet driver k 1 fet driver fet driver gate 1 gate 2 s1 gate 3 gate 4 s3 s3 gate 6 gate 5 gate 6 gate 5 dspic33epxxgs202 pwm pwm pga/adc channel pwm adc channel note: k 1 , k 2 and k 3 are gains. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 16 ? 2015-2016 microchip technology inc. figure 2-6: off-line ups pga/adc adc adc adc adc pwm pwm pwm dspic33epxxgs202 pwm pwm pwm fet driver k 2 k 1 fet driver fet driver fet driver fet driver k 4 k 5 v bat gnd + v out + v out - full-bridge inverter push-pull converter v dc gnd k 3 or analog comp. fet driver note: k 1 , k 2 , k 3 , k 4 and k 5 are gains. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 17 dspic33epxxgs202 family 3.0 cpu the dspic33epxxgs202 cpu has a 16-bit (data) modified harvard architecture with an enhanced instruction set, including significant support for digital signal processing (dsp). the cpu has a 24-bit instruc- tion word with a variable length opcode field. the program counter (pc) is 23 bits wide and addresses up to 4m x 24 bits of user program memory space. an instruction prefetch mechanism helps maintain throughput and provides predictable execution. most instructions execute in a single-cycle effective execu- tion rate, with the exception of instructions that change the program flow, the double-word move ( mov.d ) instruction, psv accesses and the table instructions. overhead-free program loop constructs are supported using the do and repeat instructions, both of which are interruptible at any point. 3.1 registers the dspic33epxxgs202 devices have sixteen, 16-bit working registers in the programmers model. each of the working registers can act as a data, address or address offset register. the 16th working register (w15) operates as a software stack pointer for interrupts and calls. in addition, the dspic33epxxgs202 devices include two alternate working register sets which consist of w0 through w14. the alternate registers can be made per- sistent to help reduce the saving and restoring of register content during interrupt service routines (isrs). the alternate working registers can be assigned to a specific interrupt priority level (ipl1 through ipl6) by configuring the ctxtx<2:0> bits in the faltreg configuration register. the alternate working registers can also be accessed manually by using the ctxtswp instruction. the cctxi<2:0> and mctxi<2:0> bits in the ctxtstat register can be used to identify the current and most recent, manually selected working register sets. 3.2 instruction set the instruction set for dspic33epxxgs202 devices has two classes of instructions: the mcu class of instructions and the dsp class of instructions. these two instruction classes are seamlessly integrated into the architecture and execute from a single execution unit. the instruction set includes many addressing modes and was designed for optimum c compiler efficiency. 3.3 data space addressing the base data space (ds) can be addressed as 1k word or 2 kbytes and is split into two blocks, referred to as x and y data memory. each memory block has its own inde- pendent address generation unit (agu). the mcu class of instructions operates solely through the x memory agu, which accesses the entire memory map as one linear data space. certain dsp instructions operate through the x and y agus to support dual operand reads, which splits the data address space into two parts. the x and y data space boundary is device-specific. the upper 32 kbytes of the data space memory map can optionally be mapped into program space (ps) at any 16k program word boundary. the program-to-data space mapping feature, known as program space visibility (psv), lets any instruction access program space as if it were data space. refer to ?data memory? (ds70595) in the ?dspic33/pic24 family reference manual? for more details on psv and table accesses. on dspic33epxxgs202 devices, overhead-free circular buffers (modulo addressing) are supported in both x and y address spaces. the modulo addressing removes the software boundary checking overhead for dsp algorithms. the x agu circular addressing can be used with any of the mcu class of instructions. the x agu also supports bit-reversed addressing to greatly simplify input or output data re-ordering for radix-2 fft algorithms. 3.4 addressing modes the cpu supports these addressing modes: inherent (no operand) relative literal memory direct register direct register indirect each instruction is associated with a predefined addressing mode group, depending upon its functional requirements. as many as six addressing modes are supported for each instruction. note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a compre- hensive reference source. to complement the information in this data sheet, refer to ?cpu? (ds70359) in the ?dspic33/ pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 18 ? 2015-2016 microchip technology inc. figure 3-1: dspic33epxxgs202 cpu block diagram instruction decode and control 16 pcl 16 program counter 16-bit alu 24 24 24 24 x data bus pcu 16 16 16 divide support engine dsp rom latch 16 y data bus ea mux x ragu x wagu y agu 16 24 16 16 16 16 16 16 16 8 interrupt controller psv and table data access control block stack control logic loop control logic data latch data latch y data ram x data ram address latch address latch 16 data latch 16 16 16 x address bus y address bus 24 literal data program memory address latch power, reset and oscillator control signals to various blocks ports peripheral modules modules pch ir 16-bit working register arrays downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 19 dspic33epxxgs202 family 3.5 programmer?s model the programmers model for the dspic33epxxgs202 family is shown in figure 3-2 . all registers in the programmers model are memory-mapped and can be manipulated directly by instructions. table 3-1 lists a description of each register. in addition to the registers contained in the programmers model, the dspic33epxxgs202 devices contain control registers for modulo addressing, bit- reversed addressing and interrupts. these registers are described in subsequent sections of this document. all registers associated with the programmers model are memory-mapped, as shown in table 3-1 . table 3-1: programmer?s model register descriptions register(s) name description w0 through w15 ( 1 ) working register array w0 through w14 ( 1 ) alternate working register array 1 w0 through w14 ( 1 ) alternate working register array 2 acca, accb 40-bit dsp accumulators pc 23-bit program counter sr alu and dsp engine status register splim stack pointer limit value register tblpag table memory page address register dsrpag extended data space (eds) read page register rcount repeat loop counter register dcount do loop counter register dostarth ( 2 ) , dostartl ( 2 ) do loop start address register (high and low) doendh, doendl do loop end address register (high and low) corcon contains dsp engine, do loop control and trap status bits note 1: memory-mapped w0 through w14 represents the value of the register in the currently active cpu context. 2: the dostarth and dostartl registers are read-only. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 20 ? 2015-2016 microchip technology inc. figure 3-2: programmer?s model novz c tblpag pc23 pc0 7 0 d0 d15 program counter data table page address status register working/address registers dsp operand registers w0 (wreg) w1w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 frame pointer/w14 stack pointer/w15 dsp address registers ad39 ad0 ad31 dsp accumulators (1) acca accb dsrpag 9 0 ra 0 oa ob sa sb rcount 15 0 repeat loop counter dcount 15 0 do loop counter and stack dostart 23 0 do loop start address and stack 0 doend do loop end address and stack ipl2 ipl1 splim stack pointer limit ad15 23 0 srl ipl0 push.s and pop.s shadows nested do stack 0 0 oab sab x data space read page address da dc 0 0 00 corcon 15 0 cpu core control register w0-w3 d15 d0 w0 w1 w2 w3w4 w13 w14 w12 w11 w10 w9 w5 w6w7 w8 w0 w1 w2 w3w4 w13 w14 w12 w9 w5 w6w7 w8 w10 w11 d0 alternate working/address registers d15 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 21 dspic33epxxgs202 family 3.6 cpu resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 3.6.1 key resources ?cpu? (ds70359) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 22 ? 2015-2016 microchip technology inc. 3.7 cpu control registers register 3-1: sr: cpu status register r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r-0 r/w-0 oa ob sa ( 3 ) sb ( 3 ) oab sab da dc bit 15 bit 8 r/w-0 ( 2 ) r/w-0 ( 2 ) r/w-0 ( 2 ) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl2 ( 1 ) ipl1 ( 1 ) ipl0 ( 1 ) ra n ov z c bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1= bit is set 0 = bit is cleared x = bit is unknown bit 15 oa: accumulator a overflow status bit 1 = accumulator a has overflowed 0 = accumulator a has not overflowed bit 14 ob: accumulator b overflow status bit 1 = accumulator b has overflowed 0 = accumulator b has not overflowed bit 13 sa: accumulator a saturation sticky status bit ( 3 ) 1 = accumulator a is saturated or has been saturated at some time 0 = accumulator a is not saturated bit 12 sb: accumulator b saturation sticky status bit ( 3 ) 1 = accumulator b is saturated or has been saturated at some time 0 = accumulator b is not saturated bit 11 oab: oa || ob combined accumulator overflow status bit 1 = accumulators a or b have overflowed 0 = neither accumulators a or b have overflowed bit 10 sab: sa || sb combined accumulator sticky status bit 1 = accumulators a or b are saturated, or have been saturated at some time 0 = neither accumulator a or b are saturated bit 9 da: do loop active bit 1 = do loop in progress 0 = do loop not in progress bit 8 dc: mcu alu half carry/borrow bit 1 = a carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized data) of the result occurred 0 = no carry-out from the 4th low-order bit (for byte-sized data) or 8th low-order bit (for word-sized data) of the result occurred note 1: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 2: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 . 3: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoid a possible sa or sb bit write race condition, the sa and sb bits should not be modified using bit operations. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 23 dspic33epxxgs202 family bit 7-5 ipl<2:0>: cpu interrupt priority level status bits ( 1 , 2 ) 111 = cpu interrupt priority level is 7 (15); user interrupts are disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) bit 4 ra: repeat loop active bit 1 = repeat loop is in progress 0 = repeat loop is not in progress bit 3 n: mcu alu negative bit 1 = result was negative 0 = result was non-negative (zero or positive) bit 2 ov: mcu alu overflow bit this bit is used for signed arithmetic (2s complement). it indicates an overflow of the magnitude that causes the sign bit to change state. 1 = overflow occurred for signed arithmetic (in this arithmetic operation) 0 = no overflow occurred bit 1 z: mcu alu zero bit 1 = an operation that affects the z bit has set it at some time in the past 0 = the most recent operation that affects the z bit has cleared it (i.e., a non-zero result) bit 0 c: mcu alu carry/borrow bit 1 = a carry-out from the most significant bit of the result occurred 0 = no carry-out from the most significant bit of the result occurred register 3-1: sr: cpu status register (continued) note 1: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 2: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 . 3: a data write to the sr register can modify the sa and sb bits by either a data write to sa and sb or by clearing the sab bit. to avoid a possible sa or sb bit write race condition, the sa and sb bits should not be modified using bit operations. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 24 ? 2015-2016 microchip technology inc. register 3-2: corcon: core control register r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var us1 us0 edt ( 1 ) dl2 dl1 dl0 bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 ( 2 ) sfa rnd if bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing latency 0 = fixed exception processing latency bit 14 unimplemented: read as 0 bit 13-12 us<1:0>: dsp multiply unsigned/signed control bits 11 = reserved 10 = dsp engine multiplies are mixed-sign 01 = dsp engine multiplies are unsigned 00 = dsp engine multiplies are signed bit 11 edt: early do loop termination control bit ( 1 ) 1 = terminates executing do loop at the end of current loop iteration 0 = no effect bit 10-8 dl<2:0>: do loop nesting level status bits 111 = 7 do loops are active 001 = 1 do loop is active 000 = 0 do loops are active bit 7 sata: acca saturation enable bit 1 = accumulator a saturation is enabled 0 = accumulator a saturation is disabled bit 6 satb: accb saturation enable bit 1 = accumulator b saturation is enabled 0 = accumulator b saturation is disabled bit 5 satdw: data space write from dsp engine saturation enable bit 1 = data space write saturation is enabled 0 = data space write saturation is disabled bit 4 accsat: accumulator saturation mode select bit 1 = 9.31 saturation (super saturation) 0 = 1.31 saturation (normal saturation) bit 3 ipl3: cpu interrupt priority level status bit 3 ( 2 ) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: this bit is always read as 0 . 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 25 dspic33epxxgs202 family bit 2 sfa: stack frame active status bit 1 = stack frame is active; w14 and w15 address of 0x0000 to 0xffff, regardless of dsrpag 0 = stack frame is not active; w14 and w15 address of base data space bit 1 rnd: rounding mode select bit 1 = biased (conventional) rounding is enabled 0 = unbiased (convergent) rounding is enabled bit 0 if: integer or fractional multiplier mode select bit 1 = integer mode is enabled for dsp multiply 0 = fractional mode is enabled for dsp multiply register 3-2: corcon: core control register (continued) note 1: this bit is always read as 0 . 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level. register 3-3: ctxtstat: cpu w re gister context status register u-0 u-0 u-0 u-0 u-0 r-0 r-0 r-0 cctxi2 cctxi1 cctxi0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r-0 r-0 r-0 mctxi2 mctxi1 mctxi0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as 0 bit 10-8 cctxi<2:0>: current (w register) context identifier bits 111 = reserved 011 = reserved 010 = alternate working register set 2 is currently in use 001 = alternate working register set 1 is currently in use 000 = default register set is currently in use bit 7-3 unimplemented: read as 0 bit 2-0 mctxi<2:0>: manual (w register) context identifier bits 111 = reserved 011 = reserved 010 = alternate working register set 2 was most recently manually selected 001 = alternate working register set 1 was most recently manually selected 000 = default register set was most recently manually selected downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 26 ? 2015-2016 microchip technology inc. 3.8 arithmetic logic unit (alu) the dspic33epxxgs202 family alu is 16 bits wide and is capable of addition, subtraction, bit shifts and logic operations. unless otherwise mentioned, arithmetic operations are twos complement in nature. depending on the operation, the alu can affect the values of the carry (c), zero (z), negative (n), overflow (ov) and digit carry (dc) status bits in the sr register. the c and dc status bits operate as borrow and digit borrow bits, respectively, for subtraction operations. the alu can perform 8-bit or 16-bit operations, depending on the mode of the instruction that is used. data for the alu operation can come from the w register array or data memory, depending on the addressing mode of the instruction. likewise, output data from the alu can be written to the w register array or a data memory location. refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157) for information on the sr bits affected by each instruction. the core cpu incorporates hardware support for both multiplication and division. this includes a dedicated hardware multiplier and support hardware for 16-bit divisor division. 3.8.1 multiplier using the high-speed 17-bit x 17-bit multiplier, the alu supports unsigned, signed, or mixed-sign operation in several mcu multiplication modes: 16-bit x 16-bit signed 16-bit x 16-bit unsigned 16-bit signed x 5-bit (literal) unsigned 16-bit signed x 16-bit unsigned 16-bit unsigned x 5-bit (literal) unsigned 16-bit unsigned x 16-bit signed 8-bit unsigned x 8-bit unsigned 3.8.2 divider the divide block supports 32-bit/16-bit and 16-bit/16-bit signed and unsigned integer divide operations with the following data sizes: 32-bit signed/16-bit signed divide 32-bit unsigned/16-bit unsigned divide 16-bit signed/16-bit signed divide 16-bit unsigned/16-bit unsigned divide the quotient for all divide instructions ends up in w0 and the remainder in w1. sixteen-bit signed and unsigned div instructions can specify any w register for both the 16-bit divisor (wn) and any w register (aligned) pair (w(m + 1):wm) for the 32-bit dividend. the divide algorithm takes one cycle per bit of divisor, so both 32-bit/16-bit and 16-bit/16-bit instructions take the same number of cycles to execute. 3.9 dsp engine the dsp engine consists of a high-speed 17-bit x 17-bit multiplier, a 40-bit barrel shifter and a 40-bit adder/ subtracter (with two target accumulators, round and saturation logic). the dsp engine can also perform inherent accumulator- to-accumulator operations that require no additional data. these instructions are add , sub and neg . the dsp engine has options selected through bits in the cpu core control register (corcon), as listed below: fractional or integer dsp multiply (if) signed, unsigned or mixed-sign dsp multiply (usx) conventional or convergent rounding (rnd) automatic saturation on/off for acca (sata) automatic saturation on/off for accb (satb) automatic saturation on/off for writes to data memory (satdw) accumulator saturation mode selection (accsat) table 3-2: dsp instructions summary instruction algebraic operation acc write back clr a = 0 yes ed a = (x C y) 2 no edac a = a + (x C y) 2 no mac a = a + (x y) yes mac a = a + x 2 no movsac no change in a yes mpy a = x y no mpy a = x 2 no mpy.n a = C x y no msc a = a C x y yes downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 27 dspic33epxxgs202 family 4.0 memory organization the dspic33epxxgs202 family architecture features separate program and data memory spaces, and buses. this architecture also allows the direct access of program memory from the data space (ds) during code execution. 4.1 program address space the program address memory space of the dspic33epxxgs202 family devices is 4m instructions. the space is addressable by a 24-bit value derived either from the 23-bit pc during program execution, or from table operation or data space remapping, as described in section 4.9 ?interfacing program and data memory spaces? . user application access to the program memory space is restricted to the lower half of the address range (0x000000 to 0x7fffff). the exception is the use of tblrd operations, which use tblpag to permit access to calibration data and device id sections of the configuration memory space. the program memory maps for the dspic33ep16/ 32gs202 devices are shown in figure 4-1 and figure 4-2 . 4.2 unique device identifier (udid) all dspic33epxxgs202 family devices are individu- ally encoded during final manufacturing with a unique device identifier or udid. this feature allows for manufacturing traceability of microchip technology devices in applications where this is a requirement. it may also be used by the application manufacturer for any number of things that may require unique identification, such as: tracking the device unique serial number unique security key the udid comprises five 24-bit program words. when taken together, these fields form a unique 120-bit identifier. the udid is stored in five read-only locations, located between 800f00h and 800f08h in the device configuration space. table 4-1 lists the addresses of the identifier words and shows their contents. table 4-1: udid addresses note: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?dspic33e/pic24e program memory? (ds70000613) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). name address bits 23:16 bits 15:8 bits 7:0 udid1 800f00 udid word 1 udid2 800f02 udid word 2 udid3 800f04 udid word 3 udid4 800f06 udid word 4 udid5 800f08 udid word 5 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 28 ? 2015-2016 microchip technology inc. figure 4-1: program memory map for DSPIC33EP16GS202 devices reset address 0x000000 0x000002 write latches user program flash memory 0x002b80 0x002b7e (5312 instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read 0 s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space device configuration 0x002c00 0x002bfe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 0x800c00 0x800bfe 0x801000 0x800ffe executive code memory reserved otp memory 0x800f80 0x800f7e downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 29 dspic33epxxgs202 family figure 4-2: program memory map for dspic33ep32gs202 devices reset address 0x000000 0x000002 write latches user program flash memory 0x005780 0x00577e (10,944 instructions) 0x800000 0xfa0000 0xfa0002 0xfa0004 devid 0xfefffe 0xff0000 0xfffffe 0xf9fffe unimplemented (read 0 s) goto instruction 0x000004 reserved 0x7ffffe reserved 0x000200 0x0001fe interrupt vector table configuration memory space user memory space device configuration 0x005800 0x0057fe reserved 0xff0002 note: memory areas are not shown to scale. 0xff0004 executive code memory 0x800f80 0x800f7e 0x801000 0x800ffe otp memory reserved 0x800c00 0x800bfe downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 30 ? 2015-2016 microchip technology inc. 4.2.1 program memory organization the program memory space is organized in word- addressable blocks. although it is treated as 24 bits wide, it is more appropriate to think of each address of the program memory as a lower and upper word, with the upper byte of the upper word being unimplemented. the lower word always has an even address, while the upper word has an odd address ( figure 4-3 ). program memory addresses are always word-aligned on the lower word, and addresses are incremented, or decremented, by two during code execution. this arrangement provides compatibility with data memory space addressing and makes data in the program memory space accessible. 4.2.2 interrupt and trap vectors all dspic33epxxgs202 family devices reserve the addresses between 0x000000 and 0x000200 for hard- coded program execution vectors. a hardware reset vector is provided to redirect code execution from the default value of the pc on device reset to the actual start of code. a goto instruction is programmed by the user application at address, 0x000000, of flash memory, with the actual address for the start of code at address, 0x000002, of flash memory. a more detailed discussion of the interrupt vector tables (ivts) is provided in section 7.1 ?interrupt vector table? . figure 4-3: program memory organization 0 8 16 pc address 0x000000 0x000002 0x000004 0x000006 23 0000000000000000 00000000 00000000 program memory phantom byte (read as 0 ) least significant word most significant word instruction width 0x000001 0x000003 0x000005 0x000007 msw address (lsw address) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 31 dspic33epxxgs202 family 4.3 data address space the dspic33epxxgs202 family cpu has a separate 16-bit wide data memory space. the data space is accessed using separate address generation units (agus) for read and write operations. the data memory map is shown in figure 4-4 . all effective addresses (eas) in the data memory space are 16 bits wide and point to bytes within the data space. this arrangement gives a base data space address range of 64 kbytes or 32k words. the lower half of the data memory space (i.e., when ea<15> = 0 ) is used for implemented memory addresses, while the upper half (ea<15> = 1 ) is reserved for the program space visibility (psv). dspic33epxxgs202 family devices implement up to 12 kbytes of data memory. if an ea points to a location outside of this area, an all-zero word or byte is returned. 4.3.1 data space width the data memory space is organized in byte- addressable, 16-bit wide blocks. data is aligned in data memory and registers as 16-bit words, but all data space eas resolve to bytes. the least significant bytes (lsbs) of each word have even addresses, while the most significant bytes (msbs) have odd addresses. 4.3.2 data memory organization and alignment to maintain backward compatibility with pic ? mcu devices and improve data space memory usage efficiency, the dspic33epxxgs202 family instruc- tion set supports both word and byte operations. as a consequence of byte accessibility, all effective address calculations are internally scaled to step through word- aligned memory. for example, the core recognizes that post-modified register indirect addressing mode [ws++] results in a value of ws + 1 for byte operations and ws + 2 for word operations. a data byte read, reads the complete word that contains the byte, using the lsb of any ea to determine which byte to select. the selected byte is placed onto the lsb of the data path. that is, data memory and reg- isters are organized as two parallel, byte-wide entities with shared (word) address decode, but separate write lines. data byte writes only write to the corresponding side of the array or register that matches the byte address. all word accesses must be aligned to an even address. misaligned word data fetches are not supported, so care must be taken when mixing byte and word operations, or translating from 8-bit mcu code. if a misaligned read or write is attempted, an address error trap is generated. if the error occurred on a read, the instruction underway is completed. if the error occurred on a write, the instruction is executed but the write does not occur. in either case, a trap is then executed, allowing the system and/or user application to examine the machine state prior to execution of the address fault. all byte loads into any w register are loaded into the lsb; the msb is not modified. a sign-extend ( se ) instruction is provided to allow user applications to translate 8-bit signed data to 16-bit signed values. alternatively, for 16-bit unsigned data, user applications can clear the msb of any w register by executing a zero-extend ( ze ) instruction on the appropriate address. 4.3.3 sfr space the first 4 kbytes of the near data space, from 0x0000 to 0x0fff, are primarily occupied by special function registers (sfrs). these are used by the dspic33epxxgs202 family core and peripheral modules for controlling the operation of the device. sfrs are distributed among the modules that they control, and are generally grouped together by module. much of the sfr space contains unused addresses; these are read as 0 . 4.3.4 near data space the 8-kbyte area, between 0x0000 and 0x1fff, is referred to as the near data space. locations in this space are directly addressable through a 13-bit absolute address field within all memory direct instructions. addi- tionally, the whole data space is addressable using mov instructions, which support memory direct addressing mode with a 16-bit address field, or by using indirect addressing mode using a working register as an address pointer. note: the actual set of peripheral features and interrupts varies by the device. refer to the corresponding device tables and pinout diagrams for device-specific information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 32 ? 2015-2016 microchip technology inc. figure 4-4: data memory map for dspic33ep16/32gs202 devices 0x0000 0x0ffe 0x13fe 0xfffe lsb address 16 bits lsb msb msb address 0x0001 0x0fff 0x13ff 0xffff optionally mapped into program memory using 0x17ff 0x17fe 0x1001 0x1000 0x1401 0x1400 4-kbyte sfr space 2-kbyte sram space 0x1800 0x1801 data space near 8-kbyte sfr space x data ram (x) program visibility space 0x8000 0x8001 note: memory areas are not shown to scale. y data ram (y) 0x1fff 0x2001 0x1ffe 0x2000 dsrpag register downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 33 dspic33epxxgs202 family 4.3.5 x and y data spaces the dspic33epxxgs202 core has two data spaces, x and y. these data spaces can be considered either separate (for some dsp instructions) or as one unified linear address range (for mcu instructions). the data spaces are accessed using two address generation units (agus) and separate data paths. this feature allows certain instructions to concurrently fetch two words from ram, thereby enabling efficient execution of dsp algorithms, such as finite impulse response (fir) filtering and fast fourier transform (fft). the x data space is used by all instructions and supports all addressing modes. x data space has separate read and write data buses. the x read data bus is the read data path for all instructions that view data space as combined x and y address space. it is also the x data prefetch path for the dual operand dsp instructions ( mac class). the y data space is used in concert with the x data space by the mac class of instructions ( clr , ed , edac , mac , movsac , mpy , mpy.n and msc ) to provide two concurrent data read paths. both the x and y data spaces support modulo address- ing mode for all instructions, subject to addressing mode restrictions. bit-reversed addressing mode is only supported for writes to x data space. all data memory writes, including in dsp instructions, view data space as combined x and y address space. the boundary between the x and y data spaces is device-dependent and is not user-programmable. 4.4 memory resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 4.4.1 key resources ?dspic33e/pic24e program memory? (ds70000613) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 34 ? 2015-2016 microchip technology inc. 4.5 special function register maps table 4-2: cpu core register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets w0 0000 w0 (wreg) xxxx w1 0002 w1 xxxx w2 0004 w2 xxxx w3 0006 w3 xxxx w4 0008 w4 xxxx w5 000a w5 xxxx w6 000c w6 xxxx w7 000e w7 xxxx w8 0010 w8 xxxx w9 0012 w9 xxxx w10 0014 w10 xxxx w11 0016 w11 xxxx w12 0018 w12 xxxx w13 001a w13 xxxx w14 001c w14 xxxx w15 001e w15 xxxx splim 0020 splim 0000 accal 0022 accal 0000 accah 0024 accah 0000 accau 0026 sign extension of acca<39> accau 0000 accbl 0028 accbl 0000 accbh 002a accbh 0000 accbu 002c sign extension of accb<39> accbu 0000 pcl 002e pcl<15:1> 0000 pch 0030 pch<6:0> 0000 dsrpag 0032 extended data space (eds) read page register (dsrpag<9:0>) 0001 dswpag ( 1 ) 0034 extended data space (eds) write page register (dswpag8:0>) ( 1 ) 0001 rcount 0036 rcount<15:0> 0000 dcount 0038 do loop counter register (dcount<15:0>) 0000 dostartl 003a do loop start address register low (dostartl<15:1>) 0000 dostarth 003c do loop start address register high (dostarth<5:0>) 0000 legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. note 1: the contents of this register should never be modified. the dswpag must always point to the first page. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 35 dspic33epxxgs202 family doendl 003e do loop end address register low (doendl<15:1>) 0000 doendh 0040 do loop end address register high (doendh<5:0>) 0000 sr 0042 oa ob sa sb oab sab da dc ipl2 ipl1 ipl0 ra n ov z c 0000 corcon 0044 var us1 us0 edt dl2 dl1 dl0 sata satb satdw accsat ipl3 sfa rnd if 0020 modcon 0046 xmoden ymoden bwm3 bwm2 bwm1 bwm0 ywm3 ywm2 ywm1 ywm0 xwm3 xwm2 xwm1 xwm0 0000 xmodsrt 0048 x mode start address register (xmodsrt<15:1>) 0000 xmodend 004a x mode end address register (xmodend<15:1>) 0001 ymodsrt 004c y mode start address register (ymodsrt<15:1>) 0000 ymodend 004e y mode end address register (ymodend<15:1>) 0001 xbrev 0050 bren xbrev<14:0> 0000 disicnt 0052 disicnt<13:0> 0000 tblpag 0054 t b l p a g < 7 : 0 > 0000 ctxtstat 005a cctxi2 cctxi1 cctxi0 mctxi2 mctxi1 mctxi0 0000 table 4-2: cpu core register map (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. note 1: the contents of this register should never be modified. the dswpag must always point to the first page. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 36 ? 2015-2016 microchip technology inc. table 4-3: interrupt controller register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ifs0 0800 nvmif adcif u1txif u1rxif spi1if spi1eif t3if t2if t1if oc1if ic1if int0if 0000 ifs1 0802 i n t 2 i f int1if cnif ac1if mi2c1if si2c1if 0000 ifs3 0806 p s e m i f 0000 ifs4 0808 psesif u 1 e i f 0000 ifs5 080a pwm2if pwm1if 0000 ifs6 080c adcan1if adcan0if a c 2 i f p w m 3 i f 0000 ifs7 080e adcan7if adcan6if adcan5if adcan4if adcan3if adcan2if 0000 ifs9 0812 a d c a n 1 4 i f adcan11if adcan10if adcan9if adcan8if 0000 ifs10 0814 i2c1bcif 0000 ifs11 0816 adfl0if adcmp1if adcmp0if 0000 iec0 0820 nvmie adcie u1txie u1rxie spi1ie spi1eie t3ie t2ie t1ie oc1ie ic1ie int0ie 0000 iec1 0822 i n t 2 i e int1ie cnie ac1if mi2c1ie si2c1ie 0000 iec3 0826 p s e m i e 0000 iec4 0828 psesie u 1 e i e 0000 iec5 082a pwm2ie pwm1ie 0000 iec6 082c adcan1ie adcan0ie a c 3 i ea c 2 i e p w m 3 i e 0000 iec7 082e adcan7ie adcan6ie adcan5ie adcan4ie adcan3ie adcan2ie 0000 iec9 0832 adcan14ie adcan11ie adcan10ie adcan9ie adcan8ie 0000 iec10 0834 i2c1bcie 0000 iec11 0836 adfl0ie adcmp1ie adcmp0ie 0000 ipc0 0840 t1ip2 t1ip1 t1ip0 oc1ip2 oc1ip1 oc1ip0 ic1ip2 ic1ip1 ic1ip0 int0ip2 int0ip1 int0ip0 4444 ipc1 0842 t2ip2 t2ip1 t2ip0 4000 ipc2 0844 u1rxip2 u1rxip1 u1rxip0 spi1ip2 spi1ip1 spi1ip0 spi1eip2 spi1eip1 spi1eip0 t 3 i p 2t 3 i p 1t 3 i p 0 4444 ipc3 0846 nvmip2 nvmip1 nvmip0 adcip2 adcip1 adcip0 u1txip2 u1txip1 u1txip0 4044 ipc4 0848 cnip2 cnip1 cnip0 ac1ip2 ac1ip1 ac1ip0 mi2c1ip2 mi2c1ip1 mi2c1ip0 si2c1ip2 si2c1ip1 si2c1ip0 4444 ipc5 084a int1ip2 int1ip1 int1ip0 0004 ipc7 084e int2ip2 int2ip1 int2ip0 0040 ipc14 085c psemip2 psemip1 psemip0 0040 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 37 dspic33epxxgs202 family ipc16 0860 u1eip2 u1eip1 u1eip0 0040 ipc18 0864 psesip2 psesip1 psesip0 0040 ipc23 086e pwm2ip2 pwm2ip1 pwm2ip0 pwm1ip2 pwm1ip1 pwm1ip0 4400 ipc24 0870 pwm3ip2 pwm3ip1 pwm3ip0 0004 ipc25 0872 ac2ip2 ac2ip1 ac2ip0 4000 ipc27 0876 adcan1ip2 adcan1ip1 adcan1ip0 adcan0ip2 adcan0ip1 adcan0ip0 4400 ipc28 0878 adcan5ip2 adcan5ip1 adcan5ip0 adcan4ip2 adcan4ip1 adcan4ip0 adcan3ip2 adcan3ip1 adcan3ip0 adcan2ip2 adcan2ip1 adcan2ip0 4444 ipc29 087a adcan7ip2 adcan7ip1 adcan7ip0 adcan6ip2 adcan6ip1 adcan6ip0 0044 ipc35 0886 icdip2 icdip1 icdip0 0400 ipc37 088a adcan8ip2 adcan8ip1 adcan8ip0 4000 ipc38 088c adcan11ip2 adcan11ip1 adcan11ip0 adcan10ip2 adcan10ip1 adcan10ip0 adcan9ip2 adcan9ip1 adcan9ip0 0444 ipc39 088e adcan14ip2 adcan14ip1 adcan14ip0 0040 ipc43 0896 i2c1bcip2 i2c1bcip1 i2c1bcip0 0040 ipc44 0898 adfl0ip2 adfl0ip1 adfl0ip0 adcmp1ip2 adcmp1ip1 adcmp1ip0 adcmp1ip2 adcmp1ip1 adcmp1ip0 4440 intcon1 08c0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte sftac err div0err matherr addrerr stkerr oscfail 0000 intcon2 08c2 gie disi swtrap a i v t e n int2ep int1ep int0ep 8000 intcon3 08c4 n a e doovr apll 0000 intcon4 08c6 s g h t 0000 inttreg 08c8 ilr3 ilr2 ilr1 ilr0 vecnum7 vecnum6 vecnum5 vecnum4 vecnum3 vecnum2 ve cnum1 vecnum0 0000 table 4-3: interrupt controller register map (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 38 ? 2015-2016 microchip technology inc. table 4-4: timer1 through timer3 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bi t 2 bit 1 bit 0 all resets tmr1 0100 timer1 register xxxx pr1 0102 period register 1 ffff t1con 0104 ton t s i d l tgate tckps1 tckps0 tsync tcs 0000 tmr2 0106 timer2 register xxxx tmr3hld 0108 timer3 holding register (for 32-bit timer operations only) xxxx tmr3 010a timer3 register xxxx pr2 010c period register 2 ffff pr3 010e period register 3 ffff t2con 0110 ton t s i d l tgate tckps1 tckps0 t32 t c s 0000 t3con 0112 ton t s i d l tgate tckps1 tckps0 t c s 0000 legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. table 4-5: input capture 1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ic1con1 0140 icsidl ictsel2 ictsel1 ictsel0 ici1 ici0 icov icbne icm2 icm1 icm0 0000 ic1con2 0142 ictrig trigstat syncsel4 syncsel3 syncsel2 syncsel1 syncsel0 000d ic1buf 0144 input capture 1 buffer register xxxx ic1tmr 0146 input capture 1 timer register 0000 legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. table 4-6: output compare 1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 b it 1 bit 0 all resets oc1con1 0900 ocsidl octsel2 octsel1 octsel0 e n f l t a ocflta trigmode ocm2 ocm1 ocm0 0000 oc1con2 0902 fltmd fltout flttrien ocinv octrig trigstat octris syncsel4 syncsel3 syncsel2 syncsel1 syncsel0 000c oc1rs 0904 output compare 1 secondary register xxxx oc1r 0906 output compare 1 register xxxx oc1tmr 0908 timer value 1 register xxxx legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 39 dspic33epxxgs202 family table 4-7: pwm register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets ptcon 0c00 pten ptsidl sestat seien eipu syncpol syncoen syncen syncsrc2 syncsrc1 syncsrc0 sevtps3 sevtps2 sevtps1 sevtps0 0000 ptcon2 0c02 pclkdiv<2:0> 0000 ptper 0c04 pwm primary master time base period register (ptper<15:0>) fff8 sevtcmp 0c06 pwm special event compare register (sevtcmp12:0>) 0000 mdc 0c0a mdc<15:0> 0000 stcon 0c0e sestat seien eipu syncpol syncoen syncen syncsrc2 syncsrc1 syncsrc0 sevtps3 sevtps2 sevtps1 sevtps0 0000 stcon2 0c10 pclkdiv<2:0> 0000 stper 0c12 pwm secondary master time base period register (stper<15:0>) fff8 ssevtcmp 0c14 pwm sec ondary special event compare register (ssevtcmp<12:0>) 0000 chop 0c1a chpclken chopclk6 chopclk5 cho pclk4 chopclk3 chopclk2 chopclk1 chopclk0 0000 pwmkey 0c1e pwm protection lock/unlock key value register (pwmkey<15:0>) 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. table 4-8: pwm generator 1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 b it 0 all resets pwmcon1 0c20 fltstat clstat trgstat fltien clien trgien itb mdcs dtc1 dtc0 mtbs cam xpres iue 0000 iocon1 0c22 penh penl polh poll pmod1 pmod0 ovrenh ovrenl ovrdat1 ovrdat0 fltdat1 fltdat0 cld at1 cldat0 swap osync c000 fclcon1 0c24 ifltmod clsrc4 clsrc3 clsrc2 clsrc1 clsrc0 clpol clmod fltsrc4 fltsrc3 fltsrc2 fltsrc1 fltsrc0 fltpol fltmod1 fltmod0 00f8 pdc1 0c26 pwm generator 1 duty cycle register (pdc1<15:0>) 0000 phase1 0c28 pwm phase-shift value or independent time base period for the pwm generat or 1 register (phase1<15:0>) 0000 dtr1 0c2a dtr1<13:0> 0000 altdtr1 0c2c altdtr1<13:0> 0000 sdc1 0c2e sdc1<15:0> 0000 sphase1 0c30 sphase1<15:0> 0000 trig1 0c32 trgcmp<12:0> 0000 trgcon1 0c34 trgdiv3 trgdiv2 trgdiv1 trgdiv0 d t m trgstrt5 trgstrt4 trgstrt3 trgstrt2 trgstrt1 trgstrt0 0000 strig1 0c36 strgcmp<12:0> 0000 pwmcap1 0c38 pwmcap<12:0> 0000 lebcon1 0c3a phr phf plr plf fltleben clleben bch bcl bphh bphl bplh bpll 0000 lebdly1 0c3c l e b < 8 : 0 > 0000 auxcon1 0c3e hrpdis hrddis blanksel3 blanksel2 blanksel1 blanksel0 chopsel3 chopsel2 chopsel1 chopsel0 chophen choplen 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 40 ? 2015-2016 microchip technology inc. table 4-9: pwm generator 2 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon2 0c40 fltstat clstat trgstat fltien clien trgien itb mdcs dtc1 dtc0 mtbs cam xpres iue 0000 iocon2 0c42 penh penl polh poll pmod1 pmod0 ovrenh ovrenl ovrdat1 ovrdat0 fltdat1 fltdat0 cldat1 clda t0 swap osync c000 fclcon2 0c44 ifltmod clsrc4 clsrc3 clsrc2 clsrc1 clsrc0 clpol clmod fltsrc4 fltsrc3 fltsrc2 fltsrc1 fltsrc0 fltp ol fltmod1 fltmod0 00f8 pdc2 0c46 pwm generator 2 duty cycle register (pdc2<15:0>) 0000 phase2 0c48 pwm phase-shift value or independent time base period for the pwm generator 2 register (phase2<15:0>) 0000 dtr2 0c4a dtr2<13:0> 0000 altdtr2 0c4c altdtr2<13:0> 0000 sdc2 0c4e sdc2<15:0> 0000 sphase2 0c50 sphase2<15:0> 0000 trig2 0c52 trgcmp<12:0> 0000 trgcon2 0c54 trgdiv3 trgdiv2 trgdiv1 trgdiv0 d t m trgstrt5 trgstrt4 trgstrt3 trgstrt2 trgstrt1 trgstrt0 0000 strig2 0c56 strgcmp<12:0> 0000 pwmcap2 0c58 pwmcap<12:0> 0000 lebcon2 0c5a phr phf plr plf fltleben clleben bch bcl bphh bphl bplh bpll 0000 lebdly2 0c5c l e b < 8 : 0 > 0000 auxcon2 0c5e hrpdis hrddis blanksel3 blanksel2 blanksel1 blanksel0 chopsel3 chopsel2 chopsel1 chopsel0 chophen choplen 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 41 dspic33epxxgs202 family table 4-10: pwm generator 3 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 b it 4 bit 3 bit 2 bit 1 bit 0 all resets pwmcon3 0c60 fltstat clstat trgstat fltien clien trgien itb mdcs dtc1 dtc0 mtbs cam xpres iue 0000 iocon3 0c62 penh penl polh poll pmod1 pmod0 ovrenh ovrenl ovrdat1 ovrdat0 fltdat1 fltdat0 cldat1 cldat0 swap osync c000 fclcon3 0c64 ifltmod clsrc4 clsrc3 clsrc2 clsrc1 clsrc0 clpol clmod fltsrc4 fltsrc3 fltsrc2 fltsrc1 fltsrc0 fltpol fltmod1 fltmod0 00f8 pdc3 0c66 pwm generator 3 duty cycle value register (pdc3<15:0>) 0000 phase3 0c68 phase-shift value or independent time base period for the pwm generator 3 register (phase3<15:0>) 0000 dtr3 0c6a dtr3<13:0> 0000 altdtr3 0c6c altdtr3<13:0> 0000 sdc3 0c6e sdc3<15:0> 0000 sphase3 0c70 sphase3<15:0> 0000 trig3 0c72 trgcmp<12:0> 0000 trgcon3 0c74 trgdiv3 trgdiv2 trgdiv1 trgdiv0 d t m trgstrt5 trgstrt4 trgstrt3 trgstrt2 trgstrt1 trgstrt0 0000 strig3 0c76 strgcmp<12:0> 0000 pwmcap3 0c78 pwmcap<12:0> 0000 lebcon3 0c7a phr phf plr plf fltleben clleben bch bcl bphh bphl bplh bpll 0000 lebdly3 0c7c l e b < 8 : 0 > 0000 auxcon3 0c7e hrpdis hrddis blanksel3 blanksel2 blanksel1 blanksel0 chopsel3 chopsel2 chopsel1 chopsel0 chophen choplen 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 42 ? 2015-2016 microchip technology inc. table 4-13: spi1 register map table 4-11: i2c1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets i2c1conl 0200 i2cen i2csidl sclrel strict a10m disslw smen gcen stren ackdt acken rcen pen rsen sen 1000 i2c1conh 0202 pcie scie boen sdaht sbcde ahen dhen 0000 i2c1stat 0204 ackstat trstat acktim bcl gcstat add10 iwcol i2cov d_a p s r_w rbf tbf 0000 i2c1add 0206 i2c1 address register 0000 i2c1msk 0208 i2c1 address mask register 0000 i2c1brg 020a baud rate generator register 0000 i2c1trn 020c i2c1 transmit register 00ff i2c1rcv 020e i2c1 receive register 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. table 4-12: uart1 register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets u1mode 0220 uarten usidl iren rtsmd uen1 uen0 wake lpback abaud urxinv brgh pdsel1 pdsel0 stsel 0000 u1sta 0222 utxisel1 utxinv utxisel0 utxbrk utxen utxbf trmt urxisel1 urxisel0 adden ridle perr ferr oerr urxda 0110 u1txreg 0224 uart1 transmit register xxxx u1rxreg 0226 uart1 receive register 0000 u1brg 0228 baud rate generator prescaler register 0000 legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets spi1stat 0240 spien spisidl spibec2 spibec1 spibec0 srmpt spirov srxmpt sisel2 sisel1 sisel0 spitbf spirbf 0000 spi1con1 0242 dissck dissdo mode16 smp cke ssen ckp msten spre2 spre1 spre0 ppre1 ppre0 0000 spi1con2 0244 frmen spifsd frmpol frmdly spiben 0000 spi1buf 0248 spi1 transmit and receive buffer register 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 43 dspic33epxxgs202 family table 4-14: adc register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets adcon1l 0300 adon a d s i d l 1000 adcon1h 0302 form shrres1 shrres0 0060 adcon2l 0304 refcie refercie e i e n shreisel2 shreisel1 shreisel0 shradcs6 shradcs5 shradcs4 shradcs3 shradcs2 shradcs1 shradcs0 0000 adcon2h 0306 refrdy referr shrsamc9 shrsamc8 shrsamc7 shrsamc6 shrsamc5 shrsamc4 shrsamc3 shrsamc2 shrsamc1 shrsa mc0 0000 adcon3l 0308 refsel2 refsel1 refsel0 suspend suspcie susprdy shrsamp cnvrtch sw lctrg swctrg cnvchsel5 cnvchsel4 cnvchsel3 cnvchsel2 cnvchsel1 cn vchsel0 0000 adcon3h 030a clksel1 clksel0 clkdiv5 clkdiv4 clkdiv3 clkdiv2 clkdiv1 clkd iv0 shren c1en c0en 0000 adcon4l 030c synctrg1 synctrg0 samc1en samc0en 0000 adcon4h 030e c1chs1 c1chs0 c0chs1 c0chs0 0000 admod0l 0310 s i g n 7 s i g n 6 s i g n 5 s i g n 4 s i g n 3 sign2 diff1 sign1 diff0 sign0 0000 admod0h 0312 diff14 sign14 s i g n 1 3 s i g n 1 2 s i g n 1 1 s i g n 1 0 s i g n 9 s i g n 8 0000 adiel 0320 i e 1 4 ie<11:0 0000 adstatl 0330 an14rdy an11rdy an10rdy an9rdy an8rdy an7rdy an6rdy an5rdy an4rdy an3rdy an2rdy an1rdy an0rdy 0000 adcmp0enl 0338 c m p e n 1 4 cmpen<11:0> 0000 adcmp0lo 033c adc cmplo register 0000 adcmp0hi 033e adc cmphi register 0000 adcmp1enl 0340 c m p e n 1 4 cmpen<11:0> 0000 adcmp1lo 0344 adc cmplo register 0000 adcmp1hi 0346 adc cmphi register 0000 adfl0dat 0368 adc fldata register 0000 adfl0con 036a flen mode1 mode0 ovrsam2 ovrsam1 ovrsam0 ie rdy flchsel4 flchsel3 flchsel2 flchsel1 flchsel0 0000 adtrig0l 0380 trgsrc1<4:0> t r g s r c 0 < 4 : 0 > 0000 adtrig0h 0382 trgsrc3<4:0> trgsrc2<4:0> 0000 adtrig1l 0384 trgsrc5<4:0> trgsrc4<4:0> 0000 adtrig1h 0386 trgsrc7<4:0> trgsrc6<4:0> 0000 adtrig2l 0388 trgsrc9<4:0> trgsrc8<4:0> 0000 adtrig2h 038a trgsrc11<4:0> trgsrc10<4:0> 0000 adtrig3l 038c trgsrc13<4:0> trgsrc12<4:0> 0000 adtrig3h 038e trgsrc14<4:0> 0000 adcmp0con 03a0 chnl4 chnl3 chnl2 chnl1 chnl0 cmpen ie stat btwn hihi hilo lohi lolo 0000 adcmp1con 03a4 chnl4 chnl3 chnl2 chnl1 chnl0 cmpen ie stat btwn hihi hilo lohi lolo 0000 adlvltrgl 03d0 l v l e n 1 4 lvlen<11:0> 0000 adcore0l 03d4 samc<9:0> 0000 adcore0h 03d6 eisel2 eisel1 eisel0 res1 res0 adcs6 adcs5 adcs4 adcs3 adcs2 adcs1 adcs0 0000 adcore1l 03d8 samc<9:0> 0000 adcore1h 03da eisel2 eisel1 eisel0 res1 res0 adcs6 adcs5 adcs4 adcs3 adcs2 adcs1 adcs0 0000 adeiel 03f0 e i e n 1 4 eien<11:0 0000 adeistatl 03f8 e i s t a t 1 4 eistat<11:0> 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 44 ? 2015-2016 microchip technology inc. adcon5l 0400 shrrdy c1rdy c0rdy shrpwr c 1 p w rc 0 p w r 0000 adcon5h 0402 warmtime3 warmtime2 warmtime1 warmtime0 shrcie c1cie c0cie 0000 adcal0l 0404 cal1rdy cal1skip cal1diff cal1en cal1run cal0rdy cal0skip cal0diff cal0en cal0run 0000 adcal1h 040a cshrrdy cshrskip cshrdiff cshren cshrrun 0000 adcbuf0 040c adc data buffer 0 0000 adcbuf1 040e adc data buffer 1 0000 adcbuf2 0410 adc data buffer 2 0000 adcbuf3 0412 adc data buffer 3 0000 adcbuf4 0414 adc data buffer 4 0000 adcbuf5 0416 adc data buffer 5 0000 adcbuf6 0418 adc data buffer 6 0000 adcbuf7 041a adc data buffer 7 0000 adcbuf8 041c adc data buffer 8 0000 adcbuf9 041e adc data buffer 9 0000 adcbuf10 0420 adc data buffer 10 0000 adcbuf11 0422 adc data buffer 11 0000 adcbuf14 0428 adc data buffer 14 0000 table 4-14: adc register map (continued) file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 45 dspic33epxxgs202 family table 4-15: peripheral pin select output register map table 4-16: peripheral pin select input register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpor0 0670 rp33r5rp33r4rp33r3rp33r2rp33r1rp33r0 rp32r5 rp32r4 rp32r3 rp32r2 rp32r1 rp32r0 0000 rpor1 0672 rp35r5rp35r4rp35r3rp35r2rp35r1rp35r0 rp34r5 rp34r4 rp34r3 rp34r2 rp34r1 rp34r0 0000 rpor2 0674 rp37r5rp37r4rp37r3rp37r2rp37r1rp37r0 rp36r5 rp36r4 rp36r3 rp36r2 rp36r1 rp36r0 0000 rpor3 0676 rp39r5rp39r4rp39r3rp39r2rp39r1rp39r0 rp38r5 rp38r4 rp38r3 rp38r2 rp38r1 rp38r0 0000 rpor4 0678 rp41r5rp41r4rp41r3rp41r2rp41r1rp41r0 rp40r5 rp40r4 rp40r3 rp40r2 rp40r1 rp40r0 0000 rpor5 067a rp43r5rp43r4rp43r3rp43r2rp43r1rp43r0 rp42r5 rp42r4 rp42r3 rp42r2 rp42r1 rp42r0 0000 rpor6 067c rp45r5rp45r4rp45r3rp45r2rp45r1rp45r0 rp44r5 rp44r4 rp44r3 rp44r2 rp44r1 rp44r0 0000 rpor7 067e rp47r5rp47r4rp47r3rp47r2rp47r1rp47r0 rp46r5 rp46r4 rp46r3 rp46r2 rp46r1 rp46r0 0000 rpor8 0680 rp177r5 rp177r4 rp177r3 rp177r2 rp177r1 rp177r0 rp176r5 rp176r4 rp176r3 rp176r2 rp176r1 rp176r0 0000 rpor9 0682 rp179r5 rp179r4 rp179r3 rp179r2 rp179r1 rp179r0 rp178r5 rp178r4 rp178r3 rp178r2 rp178r1 rp178r0 0000 rpor10 0684 rp181r5 rp181r4 rp181r3 rp181r2 rp181r1 rp181r0 rp180r5 rp180r4 rp180r3 rp180r2 rp180r1 rp180r0 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rpinr0 06a0 int1r<7:0> 0000 rpinr1 06a2 i n t 2 r < 7 : 0 > 0000 rpinr2 06a4 t1ckr<7:0> 0000 rpinr3 06a6 t3ckr7 t3ckr6 t3ckr5 t3ckr4 t3ckr3 t3ckr2 t3ckr1 t3ckr0 t2ckr7 t2c kr6 t2ckr5 t2ckr4 t2ckr3 t2ckr2 t2ckr1 t2ckr0 0000 rpinr7 06ae ic1r<7:0> 0000 rpinr11 06b6 o c f a r < 7 : 0 > 0000 rpinr12 06b8 flt2r7 flt2r6 flt2r5 flt2r4 flt2r3 flt2r2 flt2r1 flt2r0 flt1r7 flt1r6 flt1r5 flt1r4 flt1r3 flt1r2 flt1r1 flt1r0 0000 rpinr13 06ba flt4r7 flt4r6 flt4r5 flt4r4 flt4r3 flt4r2 flt4r1 flt4r0 flt3r7 flt3r6 flt3r5 flt3r4 flt3r3 flt3r2 flt3r1 flt3r0 0000 rpinr18 06c4 u1ctsr7 u1ctsr6 u1ctsr5 u1ctsr4 u1ctsr3 u1ctsr2 u1ctsr1 u1cts0 u1rxr7 u1rxr6 u1rxr5 u1rxr4 u1rxr3 u1rxr2 u1rxr1 u1rxr0 0000 rpinr20 06c8 sck1inr7 sck1inr6 sck1inr5 sck1inr4 sck1inr3 sck1inr2 sck1inr1 sck1inr0 sdi1r7 sdi1r6 s di1r5 sdi1r4 sdi1r3 sdi1r2 sdi1r1 sdi1r0 0000 rpinr21 06ca ss1r<7:0> 0000 rpinr37 06ea synci1r<7:0> 0000 rpinr38 06ec synci2r<7:0> 0000 rpinr42 06f4 flt6r7 flt6r6 flt6r5 flt6r4 flt6r3 flt6r2 flt6r1 flt6 r0 flt5r7 flt5r6 flt5r5 flt5r4 flt5r3 flt5r2 flt5r1 flt5r0 0000 rpinr43 06f6 flt8r7 flt8r6 flt8r5 flt8r4 flt8r3 flt8r2 flt8r1 flt8 r0 flt7r7 flt7r6 flt7r5 flt7r4 flt7r3 flt7r2 flt7r1 flt7r0 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 46 ? 2015-2016 microchip technology inc. table 4-17: nvm register map table 4-18: system control register map table 4-19: pmd register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets nvmcon 0728 wr wren wrerr nvmsidl rpdf urerr nvmop3 nvmop2 nvmop1 nvmop0 0000 nvmadr 072a nvmadr<15:0> 0000 nvmadru 072c nvmadr<23:16> 0000 nvmkey 072e nvmkey<7:0> 0000 nvmsrcadrl 0730 nvmsrcadr<15:0> 0000 nvmsrcadrh 0732 nvmsrcadr<23:16> 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets rcon 0740 trapr iopuwr vregsf cm vregs extr swr swdten wdto sleep idle bor por note 1 osccon 0742 cosc2 cosc1 cosc0 nosc2 nosc1 nosc0 clklock iolock lock c f oswen note 2 clkdiv 0744 roi doze2 doze1 doze0 dozen frcdiv2 frcdiv1 frcdiv0 pllpos t1 pllpost0 pllpre4 pllpre3 pllpre2 pllpre1 pllpre0 3040 pllfbd 0746 p l l d i v < 8 : 0 > 0030 osctun 0748 t u n < 5 : 0 > 0000 lfsr 074c lfsr<14:0> 0000 aclkcon 0750 enapll apllck selaclk apstsclr2 apstsclr1 apstsclr0 asrcsel frcsel 2740 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. note 1: rcon register reset values are dependent on the type of reset. 2: osccon register reset values are dependent on the configuration fuses. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pmd1 0760 t 3 m dt 2 m dt 1 m d p w m m d i 2 c 1 m d u 1 m d spi1md adcmd 0000 pmd2 0762 i c 1 m d o c 1 m d 0000 pmd3 0764 c m p m d 0000 pmd6 076a pwm3md pwm2md pwm1md 0000 pmd7 076c cmp2md cmp1md pga1md 0000 pmd8 076e p g a 2 m d 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip tec hnology inc. ds70005208d-page 47 dspic33epxxgs202 family table 4-21: analog comparator register map table 4-20: programmable gain amplifier register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets pga1con 0504 pgaen selpi2 selpi1 selpi0 selni2 selni1 selni0 gain2 gain1 gain0 0000 pga1cal 0506 pgacal<5:0> 0000 pga2con 0508 pgaen selpi2 selpi1 selpi0 selni2 selni1 selni0 gain2 gain1 gain0 0000 pga2cal 050a pgacal<5:0> 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 b it 1 bit 0 all resets cmp1con 0540 cmpon cmpsidl hyssel1 hyssel0 fltren fclksel insel1 insel0 hyspol cmpstat altinp cmppol 0000 cmp1dac 0542 c m r e f < 1 1 : 0 > 0000 cmp2con 0544 cmpon cmpsidl hyssel1 hyssel0 fltren fclksel insel1 insel0 hyspol cmpstat altinp cmppol 0000 cmp2dac 0546 c m r e f < 1 1 : 0 > 0000 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 48 ? 2015-2016 microchip technology inc. table 4-22: porta register map table 4-23: portb register map file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisa 0e00 trisa<4:0> 001f porta 0e02 ra<4:0> 0000 lata 0e04 l a t a < 4 : 0 > 0000 odca 0e06 odca<4:0> 0000 cnena 0e08 cniea<4:0> 0000 cnpua 0e0a cnpua<4:0> 0000 cnpda 0e0c cnpda<4:0> 0000 ansela 0e0e a n s a < 2 : 0 > 0007 legend: = unimplemented, read as 0 . reset values are shown in hexadecimal. file name addr. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 all resets trisb 0e10 trisb<15:0> ffff portb 0e12 rb<15:0> xxxx latb 0e14 latb<15:0> xxxx odcb 0e16 odcb<15:0> 0000 cnenb 0e18 cnieb<15:0> 0000 cnpub 0e1a cnpub<15:0> 0000 cnpdb 0e1c cnpdb<15:0> 0000 anselb 0e1e ansb<10:9> ansb<7:0> 06ff legend: x = unknown value on reset; = unimplemented, read as 0 . reset values are shown in hexadecimal. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 49 dspic33epxxgs202 family 4.5.1 paged memory scheme the dspic33epxxgs202 architecture extends the available data space through a paging scheme, which allows the available data space to be accessed using mov instructions in a linear fashion for pre- and post- modified effective addresses (eas). the upper half of the base data space address is used in conjunction with the data space read page (dsrpag) register to form the program space visibility (psv) address. the data space read page (dsrpag) register is located in the sfr space. construction of the psv address is shown in figure 4-5 . when dsrpag<9> = 1 and the base address bit, ea<15> = 1 , the dsrpag<8:0> bits are concate- nated onto ea<14:0> to form the 24-bit psv read address. the paged memory scheme provides access to multiple 32-kbyte windows in the psv memory. the data space read page register (dsrpag), in combination with the upper half of the data space address, can provide up to 8 mbytes of psv address space. the paged data memory space is shown in figure 4-6 . the program space (ps) can be accessed with a dsrpag of 0x200 or greater. only reads from ps are supported using the dsrpag. figure 4-5: program space visibi lity (psv) read address generation 1 dsrpag<8:0> 9 bits ea 15 bits select byte 24-bit psv ea select ea (dsrpag = dont care) no eds access select 16-bit ds ea byte ea<15> = 0 dsrpag 1 ea<15> note: ds read access when dsrpag = 0x000 will force an address error trap. = 1 dsrpag<9> generate psv address 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 50 ? 2015-2016 microchip technology inc. figure 4-6: paged data memory space program memory 0x0000 sfr registers 0x0fff 0x1000 up to 2-kbyte 0x17fe local data space 32-kbyte psv window 0xffff 0x1800 program space 0x00_0000 0x7f_ffff (lsw C <15:0>) 0x0000 (dsrpag = 0x200) psv program memory (dsrpag = 0x2ff) (dsrpag = 0x300) (dsrpag = 0x3ff) 0x7fff 0x0000 0x7fff 0x0000 0x7fff 0x0000 0x7fff ds_addr<14:0> ds_addr<15:0> (lsw) psv program memory (msb) table address space (tblpag<7:0>) program memory 0x00_0000 0x7f_ffff (msb C <23:16>) 0x0000 (tblpag = 0x00) 0xffff ds_addr<15:0> lsw using tblrdl / tblwtl , msb using tblrdh / tblwth 0x0000 (tblpag = 0x7f) 0xffff lsw using tblrdl / tblwtl , msb using tblrdh / tblwth (instruction & data) no writes allowed no writes allowed no writes allowed no writes allowed ram 0x7fff 0x8000 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 51 dspic33epxxgs202 family when a psv page overflow or underflow occurs, ea<15> is cleared as a result of the register indirect ea calculation. an overflow or underflow of the ea in the psv pages can occur at the page boundaries when: the initial address, prior to modification, addresses the psv page the ea calculation uses pre- or post-modified register indirect addressing; however, this does not include register offset addressing in general, when an overflow is detected, the dsrpag register is incremented and the ea<15> bit is set to keep the base address within the psv window. when an underflow is detected, the dsrpag register is decremented and the ea<15> bit is set to keep the base address within the psv window. this creates a linear psv address space, but only when using register indirect addressing modes. exceptions to the operation described above arise when entering and exiting the boundaries of page 0 and psv spaces. tab l e 4 - 24 lists the effects of overflow and underflow scenarios at different boundaries. in the following cases, when overflow or underflow occurs, the ea<15> bit is set and the dsrpag is not modified; therefore, the ea will wrap to the beginning of the current page: register indirect with register offset addressing modulo addressing bit-reversed addressing table 4-24: overflow and underflow scenarios at page 0 and psv space boundaries ( 2 , 3 , 4 ) o/u, r/w operation before after dsxpag ds ea<15> page description dsxpag ds ea<15> page description o, read [++wn] or [wn++] dsrpag = 0x2ff 1 psv: last lsw page dsrpag = 0x300 1 psv: first msb page o, read dsrpag = 0x3ff 1 psv: last msb page dsrpag = 0x3ff 0 see note 1 u, read [--wn] or [wn--] dsrpag = 0x001 1 psv page dsrpag = 0x001 0 see note 1 u, read dsrpag = 0x200 1 psv: first lsw page dsrpag = 0x200 0 see note 1 u, read dsrpag = 0x300 1 psv: first msb page dsrpag = 0x2ff 1 psv: last lsw page legend: o = overflow, u = underflow, r = read, w = write note 1: the register indirect addressing now addresses a location in the base data space (0x0000-0x7fff). 2: an eds access, when dsrpag = 0x000, will generate an address error trap. 3: only reads from ps are supported using dsrpag. 4: pseudolinear addressing is not supported for large offsets. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 52 ? 2015-2016 microchip technology inc. 4.5.2 extended x data space the lower portion of the base address space range, between 0x0000 and 0x7fff, is always accessible regardless of the contents of the data space read page register. it is indirectly addressable through the register indirect instructions. it can be regarded as being located in the default eds page 0 (i.e., eds address range of 0x000000 to 0x007fff with the base address bit, ea<15> = 0 , for this address range). how- ever, page 0 cannot be accessed through the upper 32 kbytes, 0x8000 to 0xffff, of base data space in combination with dsrpag = 0x000. consequently, dsrpag is initialized to 0x001 at reset. the remaining psv pages are only accessible using the dsrpag register in combination with the upper 32 kbytes, 0x8000 to 0xffff, of the base address, where base address bit, ea<15> = 1 . 4.5.3 software stack the w15 register serves as a dedicated software stack pointer (ssp) and is automatically modified by exception processing, subroutine calls and returns; however, w15 can be referenced by any instruction in the same manner as all other w registers. this simpli- fies reading, writing and manipulating the stack pointer (for example, creating stack frames). w15 is initialized to 0x1000 during all resets. this address ensures that the ssp points to valid ram in all dspic33epxxgs202 devices and permits stack avail- ability for non-maskable trap exceptions. these can occur before the ssp is initialized by the user software. you can reprogram the ssp during initialization to any location within data space. the software stack pointer always points to the first available free word and fills the software stack, work- ing from lower toward higher addresses. figure 4-7 illustrates how it pre-decrements for a stack pop (read) and post-increments for a stack push (writes). when the pc is pushed onto the stack, pc<15:0> are pushed onto the first available stack word, then pc<22:16> are pushed into the second available stack location. for a pc push during any call instruction, the msb of the pc is zero-extended before the push, as shown in figure 4-7 . during exception processing, the msb of the pc is concatenated with the lower 8 bits of the cpu status register, sr. this allows the contents of srl to be preserved automatically during interrupt processing. figure 4-7: call stack frame note: dsrpag should not be used to access page 0. an eds access with dsrpag set to 0x000 will generate an address error trap. note: to protect against misaligned stack accesses, w15<0> is fixed to 0 by the hardware. note 1: to maintain the software stack pointer (w15) coherency, w15 is never subject to (eds) paging, and is therefore, restricted to an address range of 0x0000 to 0xffff. the same applies to the w14 when used as a stack frame pointer (sfa = 1 ). 2: as the stack can be placed in, and can access x and y spaces, care must be taken regarding its use, particularly with regard to local automatic variables in a c development environment pc<15:1> b000000000 0 15 w15 (before call ) w15 (after call ) stack grows toward higher address 0x0000 pc<22:16> call subr downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 53 dspic33epxxgs202 family 4.6 instruction addressing modes the addressing modes shown in table 4-25 form the basis of the addressing modes optimized to support the specific features of individual instructions. the address- ing modes provided in the mac class of instructions differ from those in the other instruction types. 4.6.1 file register instructions most file register instructions use a 13-bit address field (f) to directly address data present in the first 8192 bytes of data memory (near data space). most file register instructions employ a working register, w0, which is denoted as wreg in these instructions. the destina- tion is typically either the same file register or wreg (with the exception of the mul instruction), which writes the result to a register or register pair. the mov instruc- tion allows additional flexibility and can access the entire data space. 4.6.2 mcu instructions the three-operand mcu instructions are of the form: operand 3 = operand 1 operand 2 where operand 1 is always a working register (that is, the addressing mode can only be register direct), which is referred to as wb. operand 2 can be a w register fetched from data memory or a 5-bit literal. the result location can either be a w register or a data memory location. the following addressing modes are supported by mcu instructions: register direct register indirect register indirect post-modified register indirect pre-modified 5-bit or 10-bit literal table 4-25: fundamental addressing modes supported note: not all instructions support all the addressing modes given above. individ- ual instructions can support different subsets of these addressing modes. addressing mode description file register direct the address of the file register is specified explicitly. register direct the contents of a register are accessed directly. register indirect the contents of wn form the effective address (ea). register indirect post-modified the contents of wn form the ea. wn i s post-modified (incremented or decremented) by a constant value. register indirect pre-modified wn is pre-modified (incremented or decremented) by a signed constant value to form the ea. register indirect with register offset (register indexed) the sum of wn and wb forms the ea. register indirect with literal offset the sum of wn and a literal forms the ea. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 54 ? 2015-2016 microchip technology inc. 4.6.3 move and accumulator instructions move instructions, and the dsp accumulator class of instructions, provide a greater degree of address- ing flexibility than other instructions. in addition to the addressing modes supported by most mcu instruc- tions, move and accumulator instructions also support register indirect with register offset addressing mode, also referred to as register indexed mode. in summary, the following addressing modes are supported by move and accumulator instructions: register direct register indirect register indirect post-modified register indirect pre-modified register indirect with register offset (indexed) register indirect with literal offset 8-bit literal 16-bit literal 4.6.4 mac instructions the dual source operand dsp instructions ( clr , ed , edac , mac , mpy , mpy.n , movsac and msc ), also referred to as mac instructions, use a simplified set of addressing modes to allow the user application to effectively manipulate the data pointers through register indirect tables. the two-source operand prefetch registers must be members of the set {w8, w9, w10, w11}. for data reads, w8 and w9 are always directed to the x ragu, and w10 and w11 are always directed to the y agu. the effective addresses generated (before and after modification) must therefore, be valid addresses within x data space for w8 and w9, and y data space for w10 and w11. in summary, the following addressing modes are supported by the mac class of instructions: register indirect register indirect post-modified by 2 register indirect post-modified by 4 register indirect post-modified by 6 register indirect with register offset (indexed) 4.6.5 other instructions besides the addressing modes outlined previously, some instructions use literal constants of various sizes. for example, bra (branch) instructions use 16-bit signed literals to specify the branch destination directly, whereas the disi instruction uses a 14-bit unsigned literal field. in some instructions, such as ulnk , the source of an operand or result is implied by the opcode itself. certain operations, such as a nop , do not have any operands. note: for the mov instructions, the addressing mode specified in the instruction can differ for the source and destination ea. how- ever, the 4-bit wb (register offset) field is shared by both source and destination (but typically, only used by one). note: not all instructions support all the addressing modes given above. individual instructions may support different subsets of these addressing modes. note: register indirect with register offset addressing mode is available only for w9 (in x space) and w11 (in y space). downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 55 dspic33epxxgs202 family 4.7 modulo addressing modulo addressing mode is a method of providing an automated means to support circular data buffers using hardware. the objective is to remove the need for software to perform data address boundary checks when executing tightly looped code, as is typical in many dsp algorithms. modulo addressing can operate in either data or program space (since the data pointer mechanism is essentially the same for both). one circular buffer can be supported in each of the x (which also provides the pointers into program space) and y data spaces. modulo addressing can operate on any w register pointer. however, it is not advisable to use w14 or w15 for modulo addressing since these two registers are used as the stack frame pointer and stack pointer, respectively. in general, any particular circular buffer can be config- ured to operate in only one direction, as there are certain restrictions on the buffer start address (for incrementing buffers) or end address (for decrementing buffers), based upon the direction of the buffer. the only exception to the usage restrictions is for buffers that have a power-of-two length. as these buffers satisfy the start and end address criteria, they can operate in a bidirectional mode (that is, address boundary checks are performed on both the lower and upper address boundaries). 4.7.1 start and end address the modulo addressing scheme requires that a starting and ending address be specified and loaded into the 16-bit modulo buffer address registers: xmodsrt, xmodend, ymodsrt and ymodend (see tab l e 4 - 2 ). the length of a circular buffer is not directly specified. it is determined by the difference between the corre- sponding start and end addresses. the maximum possible length of the circular buffer is 32k words (64 kbytes). 4.7.2 w address register selection the modulo and bit-reversed addressing control register, modcon<15:0>, contains enable flags, as well as a w register field to specify the w address registers. the xwm and ywm fields select the registers that operate with modulo addressing: if xwm = 1111 , x ragu and x wagu modulo addressing is disabled if ywm = 1111 , y agu modulo addressing is disabled the x address space pointer w register (xwm), to which modulo addressing is to be applied, is stored in modcon<3:0> (see table 4-2 ). modulo addressing is enabled for x data space when xwm is set to any value other than 1111 and the xmoden bit is set (modcon<15>). the y address space pointer w register (ywm), to which modulo addressing is to be applied, is stored in modcon<7:4>. modulo addressing is enabled for y data space when ywm is set to any value other than 1111 and the ymoden bit is set at modcon<14>. figure 4-8: modulo address ing operation example note: y space modulo addressing ea calcula- tions assume word-sized data (lsb of every ea is always clear). 0x1100 0x1163 start addr = 0x1100 end addr = 0x1163 length = 0x0032 words byte address mov #0x1100, w0 mov w0, xmodsrt ;set modulo start address mov #0x1163, w0 mov w0, modend ;set modulo end address mov #0x8001, w0 mov w0, modcon ;enable w1, x agu for modulo mov #0x0000, w0 ;w0 holds buffer fill value mov #0x1110, w1 ;point w1 to buffer do again, #0x31 ;fill the 50 buffer locations mov w0, [w1++] ;fill the next location again: inc w0, w0 ;increment the fill value downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 56 ? 2015-2016 microchip technology inc. 4.7.3 modulo addressing applicability modulo addressing can be applied to the effective address (ea) calculation associated with any w register. address boundaries check for addresses equal to: the upper boundary addresses for incrementing buffers the lower boundary addresses for decrementing buffers it is important to realize that the address boundaries check for addresses less than or greater than the upper (for incrementing buffers) and lower (for decrementing buffers) boundary addresses (not just equal to). address changes can, therefore, jump beyond boundaries and still be adjusted correctly. 4.8 bit-reversed addressing bit-reversed addressing mode is intended to simplify data reordering for radix-2 fft algorithms. it is supported by the x agu for data writes only. the modifier, which can be a constant value or register contents, is regarded as having its bit order reversed. the address source and destination are kept in normal order. thus, the only operand requiring reversal is the modifier. 4.8.1 bit-reversed addressing implementation bit-reversed addressing mode is enabled when all of these conditions are met: bwmx bits (w register selection) in the modcon register are any value other than 1111 (the stack cannot be accessed using bit-reversed addressing) the bren bit is set in the xbrev register the addressing mode used is register indirect with pre-increment or post-increment if the length of a bit-reversed buffer is m = 2 n bytes, the last n bits of the data buffer start address must be zeros. xb<14:0> is the bit-reversed addressing modifier, or pivot point, which is typically a constant. in the case of an fft computation, its value is equal to half of the fft data buffer size. when enabled, bit-reversed addressing is executed only for register indirect with pre-increment or post- increment addressing and word-sized data writes. it does not function for any other addressing mode or for byte-sized data and normal addresses are generated instead. when bit-reversed addressing is active, the w address pointer is always added to the address modifier (xb) and the offset associated with the regis- ter indirect addressing mode is ignored. in addition, as word-sized data is a requirement, the lsb of the ea is ignored (and always clear). if bit-reversed addressing has already been enabled by setting the bren (xbrev<15>) bit, a write to the xbrev register should not be immediately followed by an indirect read operation using the w register that has been designated as the bit-reversed pointer. note: the modulo corrected effective address is written back to the register only when pre-modify or post-modify addressing mode is used to compute the effective address. when an address offset (such as [w7 + w2]) is used, modulo addressing correction is performed, but the contents of the register remain unchanged. note: all bit-reversed ea calculations assume word-sized data (lsb of every ea is always clear). the xb value is scaled accordingly to generate compatible (byte) addresses. note: modulo addressing and bit-reversed addressing can be enabled simultaneously using the same w register, but bit- reversed addressing operation will always take precedence for data writes when enabled. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 57 dspic33epxxgs202 family figure 4-9: bit-reversed addressing example table 4-26: bit-reversed addres sing sequence (16-entry) normal address bit-reversed address a3 a2 a1 a0 decimal a3 a2 a1 a0 decimal 0000 0 0000 0 0001 1 1000 8 0010 2 0100 4 0011 3 1100 12 0100 4 0010 2 0101 5 1010 10 0110 6 0110 6 0111 7 1110 14 1000 8 0001 1 1001 9 1001 9 1010 10 0101 5 1011 11 1101 13 1100 12 0011 3 1101 13 1011 11 1110 14 0111 7 1111 15 1111 15 b3 b2 b1 0 b2 b3 b4 0 bit locations swapped left-to-right around center of binary value bit-reversed address xb = 0x0008 for a 16-word bit-reversed buffer b7 b6 b5 b1 b7 b6 b5 b4 b11 b10 b9 b8 b11 b10 b9 b8 b15 b14 b13 b12 b15 b14 b13 b12 sequential address pivot point downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 58 ? 2015-2016 microchip technology inc. 4.9 interfacing program and data memory spaces the dspic33epxxgs202 family architecture uses a 24-bit wide program space (ps) and a 16-bit wide data space (ds). the architecture is also a modified harvard scheme, meaning that data can also be present in the program space. to use this data successfully, it must be accessed in a way that preserves the alignment of information in both spaces. aside from normal execution, the architecture of the dspic33epxxgs202 family devices provides two methods by which program space can be accessed during operation: using table instructions to access individual bytes or words anywhere in the program space remapping a portion of the program space into the data space (program space visibility) table instructions allow an application to read or write to small areas of the program memory. this capability makes the method ideal for accessing data tables that need to be updated periodically. it also allows access to all bytes of the program word. the remapping method allows an application to access a large block of data on a read-only basis, which is ideal for look-ups from a large table of static data. the application can only access the least significant word of the program word. table 4-27: program space address construction figure 4-10: data access from program space address generation access type access space program space address <23> <22:16> <15> <14:1> <0> instruction access (code execution) user 0 pc<22:1> 0 0xxx xxxx xxxx xxxx xxxx xxx0 tblrd/tblwt (byte/word read/write) user tblpag<7:0> data ea<15:0> 0xxx xxxx xxxx xxxx xxxx xxxx configuration tblpag<7:0> data ea<15:0> 1xxx xxxx xxxx xxxx xxxx xxxx 0 program counter 23 bits program counter (1) tblpag 8 bits ea 16 bits byte select 0 1/0 user/configuration table operations (2) space select 24 bits 1/0 note 1: the least significant bit (lsb) of program space addresses is always fixed as 0 to maintain word alignment of data in the program and data spaces. 2: table operations are not required to be word-aligned. table read operations are permitted in the configuration memory space. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 59 dspic33epxxgs202 family 4.9.1 data access from program memory using table instructions the tblrdl and tblwtl instructions offer a direct method of reading or writing the lower word of any address within the program space without going through data space. the tblrdh and tblwth instructions are the only method to read or write the upper 8 bits of a program space word as data. the pc is incremented by two for each successive 24-bit program word. this allows program memory addresses to directly map to data space addresses. program memory can thus be regarded as two 16-bit wide word address spaces, residing side by side, each with the same address range. tblrdl and tblwtl access the space that contains the least significant data word. tblrdh and tblwth access the space that contains the upper data byte. two table instructions are provided to move byte or word-sized (16-bit) data to and from program space. both function as either byte or word operations. tblrdl (table read low): - in word mode, this instruction maps the lower word of the program space location (p<15:0>) to a data address (d<15:0>) - in byte mode, either the upper or lower byte of the lower program word is mapped to the lower byte of a data address. the upper byte is selected when byte select is 1 ; the lower byte is selected when it is 0 . tblrdh (table read high): - in word mode, this instruction maps the entire upper word of a program address (p<23:16>) to a data address. the phantom byte (d<15:8>) is always 0 . - in byte mode, this instruction maps the upper or lower byte of the program word to d<7:0> of the data address in the tblrdl instruc- tion. the data is always 0 when the upper phantom byte is selected (byte select = 1 ). in a similar fashion, two table instructions, tblwth and tblwtl , are used to write individual bytes or words to a program space address. the details of their operation are explained in section 5.0 ?flash program memory? . for all table operations, the area of program memory space to be accessed is determined by the table page register (tblpag). tblpag covers the entire program memory space of the device, including user application and configuration spaces. when tblpag<7> = 0 , the table page is located in the user memory space. when tblpag<7> = 1 , the page is located in configuration space. figure 4-11: accessing program memory with table instructions 0 8 16 23 00000000 00000000 00000000 00000000 phantom byte tblrdh.b (wn<0> = 0 ) tblrdl.w tblrdl.b (wn<0> = 1 ) tblrdl.b (wn<0> = 0 ) 23 15 0 tblpag 02 0x0000000x800000 0x0200000x030000 program space the address for the table operation is determined by the data ea within the page defined by the tblpag register. only read operations are shown; wr ite operations are also valid in the user memory area. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 60 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 61 dspic33epxxgs202 family 5.0 flash program memory the dspic33epxxgs202 family devices contain inter- nal flash program memory for storing and executing application code. the memory is readable, writable and erasable during normal operation over the entire v dd range. flash memory can be programmed in three ways: in-circuit serial programming? (icsp?) programming capability enhanced in-circuit serial programming (enhanced icsp) run-time self-programming (rtsp) icsp allows for a dspic33epxxgs202 family device to be serially programmed while in the end application circuit. this is done with a programming clock and pro- gramming data (pgecx/pgedx) line, and three other lines for power (v dd ), ground (v ss ) and master clear (mclr ). this allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. this also allows the most recent firmware or a custom firmware to be programmed. enhanced in-circuit serial programming uses an on- board bootloader, known as the program executive, to manage the programming process. using an spi data frame format, the program executive can erase, program and verify program memory. for more informa- tion on enhanced icsp, see the device programming specification. rtsp is accomplished using tblrd (table read) and tblwt (table write) instructions. with rtsp, the user application can write program memory data with a single program memory word and erase program mem- ory in blocks or pages of 512 instructions (1536 bytes) at a time. 5.1 table instructions and flash programming regardless of the method used, all programming of flash memory is done with the table read and table write instructions. these allow direct read and write access to the program memory space from the data memory while the device is in normal operating mode. the 24-bit target address in the program memory is formed using bits<7:0> of the tblpag register and the effective address (ea) from a w register, specified in the table instruction, as shown in figure 5-1 . the tblrdl and the tblwtl instructions are used to read or write to bits<15:0> of program memory. tblrdl and tblwtl can access program memory in both word and byte modes. the tblrdh and tblwth instructions are used to read or write to bits<23:16> of program memory. tblrdh and tblwth can also access program memory in word or byte mode. figure 5-1: addressing for table registers note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to com- plement the information in this data sheet, refer to ?flash programming? (ds70609) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. 0 program counter 24 bits program counter tblpag reg 8 bits working reg ea 16 bits byte 24-bit ea 0 1/0 select using table instruction using user/configuration space select downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 62 ? 2015-2016 microchip technology inc. 5.2 rtsp operation the dspic33epxxgs202 family flash program memory array is organized into rows of 64 instructions or 192 bytes. rtsp allows the user application to erase a single page (8 rows or 512 instructions) of memory at a time and to program one row at a time. it is possible to program two instructions at a time as well. the page erase and single row write blocks are edge-aligned, from the beginning of program memory on boundaries of 1536 bytes and 192 bytes, respectively. figure 25-14 in section 25.0 ?electri- cal characteristics? lists the typical erase and programming times. row programming is performed by loading 192 bytes into data memory and then loading the address of the first byte in that row into the nvmsrcadr register. once the write has been initiated, the device will automatically load the write latches and increment the nvmsrcadr and the nvmadr(u) registers until all bytes have been programmed. the rpdf bit (nvmcon<9>) selects the format of the stored data in ram to be either compressed or uncompressed. see figure 5-2 for data formatting. compressed data helps to reduce the amount of required ram by using the upper byte of the second word for the msb of the second instruction. the basic sequence for rtsp word programming is to use the tblwtl and tblwth instructions to load two of the 24-bit instructions into the write latches found in configuration memory space. refer to figure 4-1 through figure 4-3 for write latch addresses. program- ming is performed by unlocking and setting the control bits in the nvmcon register. all erase and program operations may optionally use the nvm interrupt to signal the successful completion of the operation. figure 5-2: uncompressed/ compressed format 5.3 programming operations a complete programming sequence is necessary for programming or erasing the internal flash in rtsp mode. the processor stalls (waits) until the program- ming operation is finished. setting the wr bit (nvmcon<15>) starts the operation and the wr bit is automatically cleared when the operation is finished. 5.3.1 programming algorithm for flash program memory programmers can program two adjacent words (24 bits x 2) of program flash memory (pfm) at a time on every other word address boundary (0x000000, 0x000004, 0x000008, etc.). to do this, it is necessary to erase the page that contains the desired address of the location the user wants to change. for protection against accidental operations, the write initiate sequence for nvmkey must be used to allow any erase or program operation to proceed. after the programming command has been executed, the user application must wait for the programming time until programming is complete. the two instructions follow- ing the start of the programming sequence should be nop s. msb1 0x00 lsw2 lsw1 increasing address 0 7 15 even byte address msb2 0x00 msb1 msb2 lsw2 lsw1 increasing address 0 7 15 even byte address uncompressed format (rpdf = 0 ) compressed format (rpdf = 1 ) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 63 dspic33epxxgs202 family 5.4 flash memory resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 5.4.1 key resources ?flash programming? (ds70609) in the ?dspic33/ pic24 family reference manual? , code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools 5.5 control registers five sfrs are used to write and erase the program flash memory: nvmcon, nvmkey, nvmadr, nvmadru and nvmsrcadr. the nvmcon register ( register 5-1 ) selects the oper- ation to be performed (page erase, word/row program) and initiates the program/erase cycle. nvmkey ( register 5-4 ) is a write-only register that is used for write protection. to start a programming or erase sequence, the user application must consecutively write 0x55 and 0xaa to the nvmkey register. there are two nvm address registers: nvmadru and nvmadr. these two registers, when concatenated, form the 24-bit effective address (ea) of the selected word/row for programming operations, or the selected page for erase operations. the nvmadru register is used to hold the upper 8 bits of the ea, while the nvmadr register is used to hold the lower 16 bits of the ea. for row programming operation, data to be written to program flash memory is written into data memory space (ram) at an address defined by the nvmsrcadr register (location of first element in row programming data). downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 64 ? 2015-2016 microchip technology inc. register 5-1: nvmcon: nonvolatil e memory (nvm) control register r/so-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 u-0 u-0 r/w-0 r/c-0 wr wren wrerr nvmsidl ( 2 ) rpdf urerr bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) r/w-0 ( 1 ) n v m o p 3 ( 3 , 4 ) nvmop2 ( 3 , 4 ) nvmop1 ( 3 , 4 ) nvmop0 ( 3 , 4 ) bit 7 bit 0 legend: c = clearable bit so = settable only bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 wr: write control bit ( 1 ) 1 = initiates a flash memory program or erase operation; the operation is self-timed and the bit is cleared by hardware once the operation is complete 0 = program or erase operation is complete and inactive bit 14 wren: write enable bit ( 1 ) 1 = enables flash program/erase operations 0 = inhibits flash program/erase operations bit 13 wrerr: write sequence error flag bit ( 1 ) 1 = an improper program or erase sequence attempt, or termination has occurr ed (bit is set automatically on any set attempt of the wr bit) 0 = the program or erase operation completed normally bit 12 nvmsidl: nvm stop in idle control bit ( 2 ) 1 = flash voltage regulator goes into standby mode during idle mode 0 = flash voltage regulator is active during idle mode bit 11-10 unimplemented: read as 0 bit 9 rpdf: row programming data format 1 = row data to be stored in ram in compressed format 0 = row data to be stored in ram in uncompressed format bit 8 urerr: row programming data underrun error bit 1 = indicates row programming operation has been terminated 0 = no data underrun error is detected bit 7-4 unimplemented: read as 0 note 1: these bits can only be reset on a por. 2: if this bit is set, power consumption will be further reduced (i idle ), and upon exiting idle mode, there is a delay (t vreg ) before flash memory becomes operational. 3: all other combinations of nvmop<3:0> are unimplemented. 4: execution of the pwrsav instruction is ignored while any of the nvm operations are in progress. 5: two adjacent words on a 4-word boundary are programmed during execution of this operation. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 65 dspic33epxxgs202 family bit 3-0 nvmop<3:0>: nvm operation select bits ( 1 , 3 , 4 ) 1111 = reserved 0101 = reserved 0100 = reserved 0011 = memory page erase operation 0010 = memory row program operation 0001 = memory double-word program operation ( 5 ) 0000 = reserved register 5-1: nvmcon: nonv olatile memory (nvm) cont rol register (continued) note 1: these bits can only be reset on a por. 2: if this bit is set, power consumption will be further reduced (i idle ), and upon exiting idle mode, there is a delay (t vreg ) before flash memory becomes operational. 3: all other combinations of nvmop<3:0> are unimplemented. 4: execution of the pwrsav instruction is ignored while any of the nvm operations are in progress. 5: two adjacent words on a 4-word boundary are programmed during execution of this operation. register 5-2: nvmadr: nonvolatil e memory lower address register r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<15:8> bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 nvmadr<15:0>: nonvolatile memory lower write address bits selects the lower 16 bits of the location to program or erase in program flash memory. this register may be read or written to by the user application. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 66 ? 2015-2016 microchip technology inc. register 5-4: nvmkey: nonvol atile memory key register register 5-3: nvmadru: nonvolatil e memory upper address register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x nvmadru<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 nvmadru<23:16>: nonvolatile memory upper write address bits selects the upper 8 bits of the location to program or erase in program flash memory. this register may be read or written to by the user application. u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 w-0 w-0 w-0 w-0 w-0 w-0 w-0 w-0 nvmkey<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 nvmkey<7:0>: key register bits (write-only) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 67 dspic33epxxgs202 family register 5-5: nvmsrcadrl: nvm source data address low register register 5-6: nvmsrcadrh: nvm source data address high register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nvmsrcadr<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nvmsrcadr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 nvmsrcadr<15:0>: source data address bits the ram address of the data to be programmed into flash when the nvmop<3:0> bits are set to row programming. r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nvmsrcadr<31:24> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nvmsrcadr<23:16> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 nvmsrcadr<31:16>: source data address bits the ram address of the data to be programmed into flash when the nvmop<3:0> bits are set to row programming. these bits must be always programmed to zero. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 68 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 69 dspic33epxxgs202 family 6.0 resets the reset module combines all reset sources and controls the device master reset signal, sysrst . the following is a list of device reset sources: por: power-on reset bor: brown-out reset mclr : master clear pin reset swr: reset instruction wdto: watchdog timer time-out reset cm: configuration mismatch reset trapr: trap conflict reset iopuwr: illegal condition device reset - illegal opcode reset - uninitialized w register reset - security reset a simplified block diagram of the reset module is shown in figure 6-1 . any active source of reset will make the sysrst signal active. on system reset, some of the registers associated with the cpu and peripherals are forced to a known reset state, and some are unaffected. all types of device reset set a corresponding status bit in the rcon register to indicate the type of reset (see register 6-1 ). a por clears all the bits, except for the bor and por bits (rcon<1:0>) that are set. the user application can set or clear any bit at any time during code execu- tion. the rcon bits only serve as status bits. setting a particular reset status bit in software does not cause a device reset to occur. the rcon register also has other bits associated with the watchdog timer and device power-saving states. the function of these bits is discussed in other sections of this manual. for all resets, the default clock source is determined by the fnosc<2:0> bits in the foscsel configura- tion register. the value of the fnoscx bits is loaded into the nosc<2:0> (osccon<10:8>) bits on reset, which in turn, initializes the system clock. figure 6-1: reset sy stem block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?reset? (ds70602) in the ?dspic33/pic24 family reference man- ual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: refer to the specific peripheral section or section 4.0 ?memory organization? of this manual for register reset states. note: the status bits in the rcon register should be cleared after they are read so that the next rcon register value after a device reset is meaningful. mclr v dd bor sleep or idle reset instruction wdt module glitch filter trap conflict illegal opcode uninitialized w register sysrst v dd rise detect por configuration mismatch security reset internal regulator downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 70 ? 2015-2016 microchip technology inc. 6.1 reset resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 6.1.1 key resources ?reset? (ds70602) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 71 dspic33epxxgs202 family register 6-1: rcon: re set control register ( 1 ) r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 r/w-0 r/w-0 trapr iopuwr v r e g s f c mv r e g s bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 extr swr swdten ( 2 ) wdto sleep idle bor por bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 trapr: trap reset flag bit 1 = a trap conflict reset has occurred 0 = a trap conflict reset has not occurred bit 14 iopuwr: illegal opcode or uninitialized w register access reset flag bit 1 = an illegal opcode detection, an illegal address mode or uninitialized w register used as an address pointer caused a reset 0 = an illegal opcode or uninitialized w register reset has not occurred bit 13-12 unimplemented: read as 0 bit 11 vregsf: flash voltage regulator standby during sleep bit 1 = flash voltage regulator is active during sleep 0 = flash voltage regulator goes into standby mode during sleep bit 10 unimplemented: read as 0 bit 9 cm: configuration mismatch flag bit 1 = a configuration mismatch reset has occurred. 0 = a configuration mismatch reset has not occurred bit 8 vregs: voltage regulator standby during sleep bit 1 = voltage regulator is active during sleep 0 = voltage regulator goes into standby mode during sleep bit 7 extr: external reset (mclr ) pin bit 1 = a master clear (pin) reset has occurred 0 = a master clear (pin) reset has not occurred bit 6 swr: software reset (instruction) flag bit 1 = a reset instruction has been executed 0 = a reset instruction has not been executed bit 5 swdten: software enable/disable of wdt bit ( 2 ) 1 = wdt is enabled 0 = wdt is disabled bit 4 wdto: watchdog timer time-out flag bit 1 = wdt time-out has occurred 0 = wdt time-out has not occurred note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does n ot cause a device reset. 2: if the wdten<1:0> configuration bits are 11 (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 72 ? 2015-2016 microchip technology inc. bit 3 sleep: wake-up from sleep flag bit 1 = device has been in sleep mode 0 = device has not been in sleep mode bit 2 idle: wake-up from idle flag bit 1 = device has been in idle mode 0 = device has not been in idle mode bit 1 bor: brown-out reset flag bit 1 = a brown-out reset has occurred 0 = a brown-out reset has not occurred bit 0 por: power-on reset flag bit 1 = a power-on reset has occurred 0 = a power-on reset has not occurred register 6-1: rcon: re set control register ( 1 ) (continued) note 1: all of the reset status bits can be set or cleared in software. setting one of these bits in software does n ot cause a device reset. 2: if the wdten<1:0> configuration bits are 11 (unprogrammed), the wdt is always enabled, regardless of the swdten bit setting. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 73 dspic33epxxgs202 family 7.0 interrupt controller the dspic33epxxgs202 family interrupt controller reduces the numerous peripheral interrupt request signals to a single interrupt request signal to the dspic33epxxgs202 family cpu. the interrupt controller has the following features: six processor exceptions and software traps seven user-selectable priority levels interrupt vector table (ivt) with a unique vector for each interrupt or exception source fixed priority within a specified user priority level fixed interrupt entry and return latencies alternate interrupt vector table (aivt) for debug support 7.1 interrupt vector table the dspic33epxxgs202 family interrupt vector table (ivt), shown in figure 7-1 , resides in program memory, starting at location, 000004h. the ivt contains six non- maskable trap vectors and up to fifty sources of interrupts. in general, each interrupt source has its own vector. each interrupt vector contains a 24-bit wide address. the value programmed into each interrupt vector location is the starting address of the associated interrupt service routine (isr). interrupt vectors are prioritized in terms of their natural priority. this priority is linked to their position in the vector table. lower addresses generally have a higher natural priority. for example, the interrupt associated with vector 0 takes priority over interrupts at any other vector address. 7.1.1 alternate interrupt vector ta b l e the alternate interrupt vector table (aivt), shown in figure 7-2 , is available only when the boot segment (bs) is defined and the aivt has been enabled. to enable the alternate interrupt vector table, the config- uration bit, aivtdis in the fsec register, must be programmed and the aivten bit must be set (intcon2<8> = 1 ). when the aivt is enabled, all interrupt and exception processes use the alternate vectors instead of the default vectors. the aivt begins at the start of the last page of the boot segment, defined by bslim<12:0>. the second half of the page is no longer usable space. the boot segment must be at least 2 pages to enable the aivt. the aivt supports debugging by providing a means to switch between an application and a support environ- ment without requiring the interrupt vectors to be reprogrammed. this feature also enables switching between applications for evaluation of different software algorithms at run time. 7.2 reset sequence a device reset is not a true exception because the interrupt controller is not involved in the reset process. the dspic33epxxgs202 family devices clear their registers in response to a reset, which forces the pc to zero. the device then begins program execution at location, 0x000000. a goto instruction at the reset address can redirect program execution to the appropriate start-up routine. note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?interrupts? (ds70000600) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: although the boot segment must be enabled in order to enable the aivt, application code does not need to be present inside of the boot segment. the aivt (and ivt) will inherit the boot segment code protection. note: any unimplemented or unused vector locations in the ivt should be pro- grammed with the address of a default interrupt handler routine that contains a reset instruction. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 74 ? 2015-2016 microchip technology inc. figure 7-1: dspic33epxxgs202 family interrupt vector table ivt decreasing natural order priority reset C goto instruction 0x000000 reset C goto address 0x000002 oscillator fail trap vector 0x000004 address error trap vector 0x000006 generic hard trap vector 0x000008 stack error trap vector 0x00000a math error trap vector 0x00000c reserved 0x00000e generic soft trap vector 0x000010 reserved 0x000012 interrupt vector 0 0x000014 interrupt vector 1 0x000016 :::: :: interrupt vector 52 0x00007c interrupt vector 53 0x00007e interrupt vector 54 0x000080 :::: :: interrupt vector 116 0x0000fc interrupt vector 117 0x0000fe interrupt vector 118 0x000100 interrupt vector 119 0x000102 interrupt vector 120 0x000104 :::: :: interrupt vector 244 0x0001fc interrupt vector 245 0x0001fe start of code 0x000200 see table 7-1 for interrupt vector details downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 75 dspic33epxxgs202 family figure 7-2: dspic33epxxgs202 family alternate interrupt vector table note 1: the address depends on the size of the boot segment defined by bslim<12:0>. [(bslim<12:0> C 1) x 0x400] + offset. aivt decreasing natural order priority reserved bslim<12:0> ( 1 ) + 0x000000 reserved bslim<12:0> ( 1 ) + 0x000002 oscillator fail trap vector bslim<12:0> ( 1 ) + 0x000004 address error trap vector bslim<12:0> ( 1 ) + 0x000006 generic hard trap vector bslim<12:0> ( 1 ) + 0x000008 stack error trap vector bslim<12:0> ( 1 ) + 0x00000a math error trap vector bslim<12:0> ( 1 ) + 0x00000c reserved bslim<12:0> ( 1 ) + 0x00000e generic soft trap vector bslim<12:0> ( 1 ) + 0x000010 reserved bslim<12:0> ( 1 ) + 0x000012 interrupt vector 0 bslim<12:0> ( 1 ) + 0x000014 interrupt vector 1 bslim<12:0> ( 1 ) + 0x000016 :::: :: interrupt vector 52 bslim<12:0> ( 1 ) + 0x00007c interrupt vector 53 bslim<12:0> ( 1 ) + 0x00007e interrupt vector 54 bslim<12:0> ( 1 ) + 0x000080 :::: :: interrupt vector 116 bslim<12:0> ( 1 ) + 0x0000fc interrupt vector 117 bslim<12:0> ( 1 ) + 0x0000fe interrupt vector 118 bslim<12:0> ( 1 ) + 0x000100 interrupt vector 119 bslim<12:0> ( 1 ) + 0x000102 interrupt vector 120 bslim<12:0> ( 1 ) + 0x000104 :::: :: interrupt vector 244 bslim<12:0> ( 1 ) + 0x0001fc interrupt vector 245 bslim<12:0> ( 1 ) + 0x0001fe see tab l e 7 - 1 for interrupt vector details downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 76 ? 2015-2016 microchip technology inc. table 7-1: interrupt vector details interrupt source vector # irq # ivt address interrupt bit location flag enable priority highest natural order priority int0 C external interrupt 0 8 0 0x000014 ifs0<0> iec0<0> ipc0<2:0> ic1 C input capture 1 9 1 0x000016 ifs0<1> iec0<1> ipc0<6:4> oc1 C output compare 1 10 2 0x000018 ifs0<2> iec0<2> ipc0<10:8> t1 C timer1 11 3 0x00001a ifs0<3> iec0<3> ipc0<14:12> reserved 12C14 4C6 0x00001c-0x000020 t2 C timer2 15 7 0x000022 ifs0<7> iec0<7> ipc1<14:12> t3 C timer3 16 8 0x000024 ifs0<8> iec0<8> ipc2<2:0> spi1e C spi1 error 17 9 0x000026 ifs0<9> iec0<9> ipc2<6:4> spi1 C spi1 transfer done 18 10 0x000028 ifs0<10> iec0<10> ipc2<10:8> u1rx C uart1 receiver 19 11 0x00002a ifs0<11> iec0<11> ipc2<14:12> u1tx C uart1 transmitter 20 12 0x00002c ifs0<12> iec0<12> ipc3<2:0> adc C adc global convert done 21 13 0x00002e ifs0<13> iec0<13> ipc3<6:4> reserved 22 14 0x000030 nvm C nvm write complete 23 15 0x000032 ifs0<15> iec0<15> ipc3<14:12> si2c1 C i2c1 slave event 24 16 0x000034 ifs1<0> iec1<0> ipc4<2:0> mi2c1 C i2c1 master event 25 17 0x000036 ifs1<1> iec1<1> ipc4<6:4> cmp1 C analog comparator 1 interrupt 26 18 0x000038 ifs1<2> iec1<2> ipc4<10:8> cn C input change interrupt 27 19 0x00003a ifs1<3> iec1<3> ipc4<14:12> int1 C external interrupt 1 28 20 0x00003c ifs1<4> iec1<4> ipc5<2:0> reserved 29-36 21-28 0x00003e-0x00004c int2 C external interrupt 2 37 29 0x00004e ifs1<13> iec1<13> ipc7<6:4> reserved 38-64 30-56 0x000050-0x000084 psem C pwm special event match 65 57 0x000086 ifs3<9> iec3<9> ipc14<6:4> reserved 63-72 55-64 0x000088-0x000094 u1e C uart1 error interrupt 73 65 0x000096 ifs4<1> iec4<1> ipc16<6:4> reserved 74-80 66-72 0x000098-0x0000a4 pwm secondary special event match 81 73 0x0000a6 ifs4<9> iec4<9> ipc18<6:4> reserved 82-101 74-93 0x0000a8-0x0000ce pwm1 C pwm1 interrupt 102 94 0x0000d0 ifs5<14> iec5<14> ipc23<10:8> pwm2 C pwm2 interrupt 103 95 0x0000d2 ifs5<15> iec5<15> ipc23<14:12> pwm3 C pwm3 interrupt 104 96 0x0000d4 ifs6<0> iec6<0> ipc24<2:0> reserved 105-110 97-102 0x0000d6-0x0000e0 cmp2 C analog comparator 2 interrupt 111 103 0x0000e2 ifs6<7> iec6<7> ipc25<14:12> reserved 112-117 104-109 0x0000e4-0x0000ee an0 conversion done 118 110 0x0000f0 ifs6<14> iec6<14> ipc27<10:8> an1 conversion done 119 111 0x0000f2 ifs6<15> iec6<15> ipc27<14:12> an2 conversion done 120 112 0x0000f4 ifs7<0> iec7<0> ipc28<2:0> an3 conversion done 121 113 0x0000f6 ifs7<1> iec7<1> ipc28<6:4> an4 conversion done 122 114 0x0000f8 ifs7<2> iec7<2> ipc28<10:8> an5 conversion done 123 115 0x0000fa ifs7<3> iec7<3> ipc28<14:12> an6 conversion done 124 116 0x0000fc ifs7<4> iec7<4> ipc29<2:0> an7 conversion done 125 117 0x0000fe ifs7<5> iec7<5> ipc29<6:4> downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 77 dspic33epxxgs202 family reserved 126-158 118-150 0x000100-0x000140 an8 conversion done 159 151 0x000142 ifs9<7> iec9<7> ipc37<14:12> an9 conversion done 160 152 0x000144 ifs9<8> iec9<8> ipc38<2:0> an10 conversion done 161 153 0x000146 ifs9<9> iec9<9> ipc38<6:4> an11 conversion done 162 154 0x000148 ifs9<10> iec9<10> ipc38<10:8> reserved 163-164 155-156 0x00014a-0x00014c an14 conversion done 165 157 0x00014e ifs9<13> iec9<13> ipc39<6:4> reserved 163-180 155-172 0x00014a-0x00016c i2c1 C i2c1 bus collision 181 173 0x00016e ifs10<13> iec10<13> ipc43<6:4> reserved 182-184 174-176 0x000170-0x000174 adcmp0 C adc digital comparator 0 185 177 0x000176 ifs11<1> iec11<1> ipc4 4<6:4> adcmp1 C adc digital comparator 1 186 178 0x000178 ifs11<2> iec11<2> ipc 44<10:8> adfl0 C adc filter 0 187 179 0x00017a ifs11<3> iec11<3> ipc44<14:12> reserved 188-253 180-245 0x00017c-0x0001fe table 7-1: interrupt vector details (continued) interrupt source vector # irq # ivt address interrupt bit location flag enable priority downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 78 ? 2015-2016 microchip technology inc. 7.3 interrupt resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 7.3.1 key resources ?interrupts? (ds70000600) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools 7.4 interrupt control and status registers dspic33epxxgs202 family devices implement the following registers for the interrupt controller: intcon1 intcon2 intcon3 intcon4 inttreg 7.4.1 intcon1 through intcon4 global interrupt control functions are controlled from intcon1, intcon2, intcon3 and intcon4. intcon1 contains the interrupt nesting disable bit (nstdis), as well as the control and status flags for the processor trap sources. the intcon2 register controls external interrupt request signal behavior, contains the global interrupt enable bit (gie) and the alternate interrupt vector table enable bit (aivten). intcon3 contains the status flags for the auxiliary pll and do stack overflow status trap sources. the intcon4 register contains the software generated hard trap status bit (sght). 7.4.2 ifsx the ifsx registers maintain all of the interrupt request flags. each source of interrupt has a status bit, which is set by the respective peripherals or external signal and is cleared via software. 7.4.3 iecx the iecx registers maintain all of the interrupt enable bits. these control bits are used to individually enable interrupts from the peripherals or external signals. 7.4.4 ipcx the ipcx registers are used to set the interrupt priority level (ipl) for each source of interrupt. each user interrupt sources can be assigned to one of seven priority levels. 7.4.5 inttreg the inttreg register contains the associated interrupt vector number and the new cpu interrupt priority level, which are latched into the vector number (vecnum<7:0>) and interrupt level bits (ilr<3:0>) fields in the inttreg register. the new interrupt priority level is the priority of the pending interrupt. the interrupt sources are assigned to the ifsx, iecx and ipcx registers in the same sequence as they are listed in table 7-1 . for example, the int0 (external interrupt 0) is shown as having vector number 8 and a natural order priority of 0. thus, the int0if bit is found in ifs0<0>, the int0ie bit in iec0<0> and the int0ip<2:0> bits in the first position of ipc0 (ipc0<2:0>). 7.4.6 status/control registers although these registers are not specifically part of the interrupt control hardware, two of the cpu control registers contain bits that control interrupt functionality. for more information on these registers refer to ?cpu? (ds70359) in the ?dspic33/pic24 family reference manual? . the cpu status register, sr, contains the ipl<2:0> bits (sr<7:5>). these bits indicate the current cpu interrupt priority level. the user software can change the current cpu interrupt priority level by writing to the iplx bits. the corcon register contains the ipl3 bit which, together with ipl<2:0>, also indicates the current cpu priority level. ipl3 is a read-only bit so that trap events cannot be masked by the user software. all interrupt registers are described in register 7-3 through register 7-7 in the following pages. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 79 dspic33epxxgs202 family register 7-1: sr: cpu status register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/c-0 r/c-0 r-0 r/w-0 oa ob sa sb oab sab da dc bit 15 bit 8 r/w-0 ( 3 ) r/w-0 ( 3 ) r/w-0 ( 3 ) r-0 r/w-0 r/w-0 r/w-0 r/w-0 ipl2 ( 2 ) ipl1 ( 2 ) ipl0 ( 2 ) ra n ov z c bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1= bit is set 0 = bit is cleared x = bit is unknown bit 7-5 ipl<2:0>: cpu interrupt priority level status bits ( 2 , 3 ) 111 = cpu interrupt priority level is 7 (15); user interrupts are disabled 110 = cpu interrupt priority level is 6 (14) 101 = cpu interrupt priority level is 5 (13) 100 = cpu interrupt priority level is 4 (12) 011 = cpu interrupt priority level is 3 (11) 010 = cpu interrupt priority level is 2 (10) 001 = cpu interrupt priority level is 1 (9) 000 = cpu interrupt priority level is 0 (8) note 1: for complete register details, see register 3-1 . 2: the ipl<2:0> bits are concatenated with the ipl<3> bit (corcon<3>) to form the cpu interrupt priority level. the value in parentheses indicates the ipl, if ipl<3> = 1 . user interrupts are disabled when ipl<3> = 1 . 3: the ipl<2:0> status bits are read-only when the nstdis bit (intcon1<15>) = 1 . downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 80 ? 2015-2016 microchip technology inc. register 7-2: corcon: core control register ( 1 ) r/w-0 u-0 r/w-0 r/w-0 r/w-0 r-0 r-0 r-0 var us1 us0 edt dl2 dl1 dl0 bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-0 r/c-0 r-0 r/w-0 r/w-0 sata satb satdw accsat ipl3 ( 2 ) sfa rnd if bit 7 bit 0 legend: c = clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1= bit is set 0 = bit is cleared x = bit is unknown bit 15 var: variable exception processing latency control bit 1 = variable exception processing latency 0 = fixed exception processing latency bit 3 ipl3: cpu interrupt priority level status bit 3 ( 2 ) 1 = cpu interrupt priority level is greater than 7 0 = cpu interrupt priority level is 7 or less note 1: for complete register details, see register 3-2 . 2: the ipl3 bit is concatenated with the ipl<2:0> bits (sr<7:5>) to form the cpu interrupt priority level. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 81 dspic33epxxgs202 family register 7-3: intcon1: in terrupt control register 1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 nstdis ovaerr ovberr covaerr covberr ovate ovbte covte bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 sftacerr div0err matherr addrerr stkerr oscfail bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 nstdis: interrupt nesting disable bit 1 = interrupt nesting is disabled 0 = interrupt nesting is enabled bit 14 ovaerr: accumulator a overflow trap flag bit 1 = trap was caused by overflow of accumulator a 0 = trap was not caused by overflow of accumulator a bit 13 ovberr: accumulator b overflow trap flag bit 1 = trap was caused by overflow of accumulator b 0 = trap was not caused by overflow of accumulator b bit 12 covaerr: accumulator a catastrophic overflow trap flag bit 1 = trap was caused by catastrophic overflow of accumulator a 0 = trap was not caused by catastrophic overflow of accumulator a bit 11 covberr: accumulator b catastrophic overflow trap flag bit 1 = trap was caused by catastrophic overflow of accumulator b 0 = trap was not caused by catastrophic overflow of accumulator b bit 10 ovate: accumulator a overflow trap enable bit 1 = trap overflow of accumulator a 0 = trap is disabled bit 9 ovbte: accumulator b overflow trap enable bit 1 = trap overflow of accumulator b 0 = trap is disabled bit 8 covte: catastrophic overflow trap enable bit 1 = trap on catastrophic overflow of accumulator a or b is enabled 0 = trap is disabled bit 7 sftacerr: shift accumulator error status bit 1 = math error trap was caused by an invalid accumulator shift 0 = math error trap was not caused by an invalid accumulator shift bit 6 div0err: divide-by-zero error status bit 1 = math error trap was caused by a divide-by-zero 0 = math error trap was not caused by a divide-by-zero bit 5 unimplemented: read as 0 bit 4 matherr: math error status bit 1 = math error trap has occurred 0 = math error trap has not occurred downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 82 ? 2015-2016 microchip technology inc. bit 3 addrerr: address error trap status bit 1 = address error trap has occurred 0 = address error trap has not occurred bit 2 stkerr: stack error trap status bit 1 = stack error trap has occurred 0 = stack error trap has not occurred bit 1 oscfail: oscillator failure trap status bit 1 = oscillator failure trap has occurred 0 = oscillator failure trap has not occurred bit 0 unimplemented: read as 0 register 7-3: intcon1: interrupt control register 1 (continued) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 83 dspic33epxxgs202 family register 7-4: intcon2: in terrupt control register 2 r/w-1 r/w-0 r/w-0 u-0 u-0 u-0 u-0 r/w-0 gie disi swtrap a i v t e n bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 int2ep int1ep int0ep bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 gie: global interrupt enable bit 1 = interrupts and associated ie bits are enabled 0 = interrupts are disabled, but traps are still enabled bit 14 disi: disi instruction status bit 1 = disi instruction is active 0 = disi instruction is not active bit 13 swtrap: software trap status bit 1 = software trap is enabled 0 = software trap is disabled bit 12-9 unimplemented: read as 0 bit 8 aivten: alternate interrupt vector table enable 1 = uses alternate interrupt vector table 0 = uses standard interrupt vector table bit 7-3 unimplemented: read as 0 bit 2 int2ep: external interrupt 2 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 1 int1ep: external interrupt 1 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge bit 0 int0ep: external interrupt 0 edge detect polarity select bit 1 = interrupt on negative edge 0 = interrupt on positive edge downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 84 ? 2015-2016 microchip technology inc. register 7-5: intcon3: in terrupt control register 3 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 n a e bit 15 bit 8 u-0 u-0 u-0 r/w-0 u-0 u-0 u-0 r/w-0 d o o v r a p l l bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as 0 bit 8 nae: nvm address error soft trap status bit 1 = nvm address error soft trap has occurred 0 = nvm address error soft trap has not occurred bit 7-5 unimplemented: read as 0 bit 4 doovr: do stack overflow soft trap status bit 1 = do stack overflow soft trap has occurred 0 = do stack overflow soft trap has not occurred bit 3-1 unimplemented: read as 0 bit 0 apll: auxiliary pll loss of lock soft trap status bit 1 = apll lock soft trap has occurred 0 = apll lock soft trap has not occurred register 7-6: intcon4: in terrupt control register 4 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 s g h t bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-1 unimplemented: read as 0 bit 0 sght: software generated hard trap status bit 1 = software generated hard trap has occurred 0 = software generated hard trap has not occurred downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 85 dspic33epxxgs202 family register 7-7: inttreg: interrupt control and status register u-0 u-0 u-0 u-0 r-0 r-0 r-0 r-0 ilr3 ilr2 ilr1 ilr0 bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 vecnum7 vecnum6 vecnum5 vecnum4 vecnum3 vecnum2 vecnum1 vecnum0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as 0 bit 11-8 ilr<3:0>: new cpu interrupt priority level bits 1111 = cpu interrupt priority level is 15 0001 = cpu interrupt priority level is 1 0000 = cpu interrupt priority level is 0 bit 7-0 vecnum<7:0>: vector number of pending interrupt bits 11111111 = 255, reserved; do not use 00001001 = 9, ic1 C input capture 1 00001000 = 8, int0 C external interrupt 0 00000111 = 7, reserved; do not use 00000110 = 6, generic soft error trap 00000101 = 5, reserved; do not use 00000100 = 4, math error trap 00000011 = 3, stack error trap 00000010 = 2, generic hard trap 00000001 = 1, address error trap 00000000 = 0, oscillator fail trap downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 86 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 87 dspic33epxxgs202 family 8.0 oscillator configuration the dspic33epxxgs202 family oscillator system provides: on-chip phase-locked loop (pll) to boost internal operating frequency on select internal and external oscillator sources on-the-fly clock switching between various clock sources doze mode for system power savings fail-safe clock monitor (fscm) that detects clock failure and permits safe application recovery or shutdown configuration bits for clock source selection auxiliary pll for adc and pwm a simplified diagram of the oscillator system is shown in figure 8-1 . note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?oscillator module? (ds70005131) in the dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 88 ? 2015-2016 microchip technology inc. figure 8-1: oscillator system diagram xtpll, hspll, xt, hs, ec frcdiv<2:0> wdt, pwrt, frcdivn frcdiv16 ecpll, frcpll, (f pllo ) nosc<2:0> fnosc<2:0> reset frc oscillator lprc oscillator doze<2:0> s3s1 s2 s1/s3 s7 s6 frc lprc s0s5 clock switch s0 clock fail 2 tun<5:0> pll f cy (2) f osc frcdiv<2:0> doze note 1: see figure 8-2 for the source of the f vco signal. 2: the term, f p , refers to the clock source for all the peripherals, while f cy (or mips) refers to the clock source for the cpu. throughout this document, f cy and f p are used interchangeably, except in the case of doze mode. f p and f cy will be different when doze mode is used in any ratio other than 1:1. 3: the auxiliary clock postscaler must be configured to divide-by-1 (apstsclr<2:0> = 111 ) for proper operation of the pwm and adc modules. fscm aclk poscclk selaclk f vco (1) asrcsel enapll apll x 16 poscclk frcclk f vco (1) n apstsclr<2:0> (3) frcclk frcsel osc2 osc1 primary oscillator (posc) poscmd<1:0> f p (2) auxiliary clock generator circuit block diagram 10 10 1 0 01 gnd pwm/adc to lfsr 16 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 89 dspic33epxxgs202 family 8.1 cpu clocking system the dspic33epxxgs202 family of devices provides six system clock options: fast rc (frc) oscillator frc oscillator with phase-locked loop (pll) frc oscillator with postscaler primary (xt, hs or ec) oscillator primary oscillator with pll low-power rc (lprc) oscillator instruction execution speed or device operating frequency, f cy , is given by equation 8-1 . equation 8-1: device operating frequency figure 8-2 is a block diagram of the pll module. equation 8-2 provides the relationship between input frequency (f in ) and output frequency (f pllo ). equation 8-3 provides the relationship between input frequency (f in ) and vco frequency (f vco ). figure 8-2: pll block diagram equation 8-2: f pllo calculation equation 8-3: f vco calculation f cy = f osc /2 n1 m n2 vco pllpre<4:0> plldiv<8:0> pllpost<1:0> f pllo (1) ? 120 mhz @ +125oc f in f plli f vco f pllo note 1: this frequency range must be met at all times. f pllo (1) ? 140 mhz @ +85oc 120 mh z < f vco (1) < 340 mh z pfd 0.8 mhz < f plli (1) < 8.0 mhz where: n 1 = pllpre <4:0> + 2 n 2 = 2 x ( pllpost <1:0> + 1) m = plldiv <8:0> + 2 f pllo = f in ? = f in ? m n 1 ? n 2 () ( plldiv <8:0> + 2) ( pllpre <4:0> + 2) ? 2( pllpost <1:0> + 1) () f vco = f in ? = f in ? m n 1 () ( plldiv <8:0> + 2) ( pllpre <4:0> + 2) () downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 90 ? 2015-2016 microchip technology inc. table 8-1: configuration bit va lues for clock selection 8.2 auxiliary clock generation the auxiliary clock generation is used for peripherals that need to operate at a frequency unrelated to the system clock, such as pwm or adc. the primary oscillator and internal frc oscillator sources can be used with an auxiliary pll (apll) to obtain the auxiliary clock. the auxiliary pll has a fixed 16x multiplication factor. the auxiliary clock has the following configuration restrictions: for proper pwm operation, auxiliary clock generation must be configured for 120 mhz (see parameter os56 in section 25.0 ?electrical char- acteristics? ). if a slower frequency is desired, the pwm input clock prescaler (divider) select bits (pclkdiv<2:0>) should be used. to achieve 1.04 ns pwm resolution, the auxiliary clock must use the 16x auxiliary pll (apll). all other clock sources will have a minimum pwm resolution of 8 ns. if the primary pll is used as a source for the auxiliary clock, the primary pll should be configured up to a maximum operation of 30 mips or less. 8.3 oscillator resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 8.3.1 key resources ?oscillator module? (ds70005131) in the dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools oscillator mode oscillator source poscmd<1:0> fnosc<2:0> see notes fast rc oscillator with divide-by-n (frcdivn) internal xx 111 1 , 2 fast rc oscillator with divide-by-16 internal xx 110 1 low-power rc oscillator (lprc) internal xx 101 1 primary oscillator (hs) with pll (hspll) primary 10 011 primary oscillator (xt) with pll (xtpll) primary 01 011 primary oscillator (ec) with pll (ecpll) primary 00 011 1 primary oscillator (hs) primary 10 010 primary oscillator (xt) primary 01 010 primary oscillator (ec) primary 00 010 1 fast rc oscillator (frc) with divide-by-n and pll (frcpll) internal xx 001 1 fast rc oscillator (frc) internal xx 000 1 note 1: osc2 pin function is determined by the osciofnc configuration bit. 2: this is the default oscillator mode for an unprogrammed (erased) device. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 91 dspic33epxxgs202 family 8.4 oscillator control registers register 8-1: osccon: os cillator control register ( 1 ) u-0 r-0 r-0 r-0 u-0 r/w-y r/w-y r/w-y cosc2 cosc1 cosc0 n o s c 2 ( 2 ) nosc1 ( 2 ) nosc0 ( 2 ) bit 15 bit 8 r/w-0 r/w-0 r-0 u-0 r/w-0 u-0 u-0 r/w-0 clklock iolock lock c f ( 3 ) oswen bit 7 bit 0 legend: y = value set from configuration bits on por r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14-12 cosc<2:0>: current oscillator selection bits (read-only) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 11 unimplemented: read as 0 bit 10-8 nosc<2:0>: new oscillator selection bits ( 2 ) 111 = fast rc oscillator (frc) with divide-by-n 110 = fast rc oscillator (frc) with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved 011 = primary oscillator (xt, hs, ec) with pll 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator (frc) with divide-by-n and pll (frcpll) 000 = fast rc oscillator (frc) bit 7 clklock: clock lock enable bit 1 = if (fcksm0 = 1 ), then clock and pll configurations are locked; if (fcksm0 = 0 ), then clock and pll configurations may be modified 0 = clock and pll selections are not locked, configurations may be modified bit 6 iolock: i/o lock enable bit 1 = i/o lock is active 0 = i/o lock is not active bit 5 lock: pll lock status bit (read-only) 1 = indicates that pll is in lock or pll start-up timer is satisfied 0 = indicates that pll is out of lock, start-up timer is in progress or pll is disabled note 1: writes to this register require an unlock sequence. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not pe rmit- ted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transitional clock source between the two pll modes. 3: this bit should only be cleared in software. setting the bit in software (= 1 ) will have the same effect as an actual oscillator failure and trigger an oscillator failure trap. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 92 ? 2015-2016 microchip technology inc. bit 4 unimplemented: read as 0 bit 3 cf: clock fail detect bit ( 3 ) 1 = fscm has detected a clock failure 0 = fscm has not detected a clock failure bit 2-1 unimplemented: read as 0 bit 0 oswen: oscillator switch enable bit 1 = requests oscillator switch to selection specified by the nosc<2:0> bits 0 = oscillator switch is complete register 8-1: osccon: os cillator control register ( 1 ) (continued) note 1: writes to this register require an unlock sequence. 2: direct clock switches between any primary oscillator mode with pll and frcpll mode are not p ermit- ted. this applies to clock switches in either direction. in these instances, the application must switch to frc mode as a transitional clock source between the two pll modes. 3: this bit should only be cleared in software. setting the bit in software (= 1 ) will have the same effect as an actual oscillator failure and trigger an oscillator failure trap. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 93 dspic33epxxgs202 family register 8-2: clkdiv: clock divisor register r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 roi doze2 ( 1 ) doze1 ( 1 ) doze0 ( 1 ) dozen ( 2 , 3 ) frcdiv2 frcdiv1 frcdiv0 bit 15 bit 8 r/w-0 r/w-1 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pllpost1 pllpost0 pllpre4 pllpre3 pllpre2 pllpre1 pllpre0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 roi: recover on interrupt bit 1 = interrupts will clear the dozen bit and the processor clock, and the peripheral clock ratio is set to 1:1 0 = interrupts have no effect on the dozen bit bit 14-12 doze<2:0>: processor clock reduction select bits ( 1 ) 111 = f cy divided by 128 110 = f cy divided by 64 101 = f cy divided by 32 100 = f cy divided by 16 011 = f cy divided by 8 (default) 010 = f cy divided by 4 001 = f cy divided by 2 000 = f cy divided by 1 bit 11 dozen: doze mode enable bit ( 2 , 3 ) 1 = doze<2:0> field specifies the ratio between the peripheral clocks and the processor clocks 0 = processor clock and peripheral clock ratio is forced to 1:1 bit 10-8 frcdiv<2:0>: internal fast rc oscillator postscaler bits 111 = frc divided by 256 110 = frc divided by 64 101 = frc divided by 32 100 = frc divided by 16 011 = frc divided by 8 010 = frc divided by 4 001 = frc divided by 2 000 = frc divided by 1 (default) bit 7-6 pllpost<1:0>: pll vco output divider select bits (also denoted as n2, pll postscaler) 11 = output divided by 8 10 = reserved 01 = output divided by 4 (default) 00 = output divided by 2 bit 5 unimplemented: read as 0 note 1: the doze<2:0> bits can only be written to when the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 2: this bit is cleared when the roi bit is set and an interrupt occurs. 3: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 94 ? 2015-2016 microchip technology inc. bit 4-0 pllpre<4:0>: pll phase detector input divider select bits (also denoted as n1, pll prescaler) 11111 = input divided by 33 00001 = input divided by 3 00000 = input divided by 2 (default) register 8-2: clkdiv: clock divisor register (continued) note 1: the doze<2:0> bits can only be written to when the dozen bit is clear. if dozen = 1 , any writes to doze<2:0> are ignored. 2: this bit is cleared when the roi bit is set and an interrupt occurs. 3: the dozen bit cannot be set if doze<2:0> = 000 . if doze<2:0> = 000 , any attempt by user software to set the dozen bit is ignored. register 8-3: pllfbd: p ll feedback divisor register u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 plldiv8 bit 15 bit 8 r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 plldiv<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as 0 bit 8-0 plldiv<8:0>: pll feedback divisor bits (also denoted as m, pll multiplier) 111111111 = 513 000110000 = 50 (default) 000000010 = 4 000000001 = 3 000000000 = 2 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 95 dspic33epxxgs202 family register 8-4: osctun: frc oscillator tuning register u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 tun<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as 0 bit 5-0 tun<5:0>: frc oscillator tuning bits 011111 = maximum frequency deviation of 1.457% (7.477 mhz) 011110 = center frequency + 1.41% (7.474 mhz) 000001 = center frequency + 0.047% (7.373 mhz) 000000 = center frequency (7.37 mhz nominal) 111111 = center frequency C 0.047% (7.367 mhz) 100001 = center frequency C 1.457% (7.263 mhz) 100000 = minimum frequency deviation of -1.5% (7.259 mhz) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 96 ? 2015-2016 microchip technology inc. register 8-5: aclkcon: auxiliary clock divisor control register r/w-0 r-0 r/w-1 u-0 u-0 r/w-1 r/w-1 r/w-1 enapll apllck selaclk apstsclr2 apstsclr1 apstsclr0 bit 15 bit 0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 u-0 asrcsel frcsel bit 7 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 enapll: auxiliary pll enable bit 1 = apll is enabled 0 = apll is disabled bit 14 apllck: apll locked status bit (read-only) 1 = indicates that the auxiliary pll is in lock 0 = indicates that the auxiliary pll is not in lock bit 13 selaclk: select auxiliary clock source for auxiliary clock divider bit 1 = auxiliary oscillators provide the source clock for the auxiliary clock divider 0 = primary pll (f vco ) provides the source clock for the auxiliary clock divider bit 12-11 unimplemented: read as 0 bit 10-8 apstsclr<2:0>: auxiliary clock output divider bits 111 = divided by 1 110 = divided by 2 101 = divided by 4 100 = divided by 8 011 = divided by 16 010 = divided by 32 001 = divided by 64 000 = divided by 256 bit 7 asrcsel: select reference clock source for auxiliary clock bit 1 = primary oscillator is the clock source 0 = no clock input is selected bit 6 frcsel: select reference clock source for auxiliary pll bit 1 = selects frc clock for auxiliary pll 0 = input clock source is determined by the asrcsel bit setting bit 5-0 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 97 dspic33epxxgs202 family register 8-6: lfsr: linear feedback shift register u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 l f s r < 1 4 : 8 > bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 lfsr<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14-0 lfsr<14:0>: pseudorandom data bits downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 98 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 99 dspic33epxxgs202 family 9.0 power-saving features the dspic33epxxgs202 family devices provide the ability to manage power consumption by selectively managing clocking to the cpu and the peripherals. in general, a lower clock frequency and a reduction in the number of peripherals being clocked constitutes lower consumed power. dspic33epxxgs202 family devices can manage power consumption in four ways: clock frequency instruction-based sleep and idle modes software-controlled doze mode selective peripheral control in software combinations of these methods can be used to selectively tailor an applications power consumption while still maintaining critical application features, such as timing-sensitive communications. 9.1 clock frequency and clock switching the dspic33epxxgs202 family devices allow a wide range of clock frequencies to be selected under appli- cation control. if the system clock configuration is not locked, users can choose low-power or high-precision oscillators by simply changing the noscx bits (osccon<10:8>). the process of changing a system clock during operation, as well as limitations to the process, are discussed in more detail in section 8.0 ?oscillator configuration? . 9.2 instruction-based power-saving modes the dspic33epxxgs202 family devices have two special power-saving modes that are entered through the execution of a special pwrsav instruc- tion. sleep mode stops clock operation and halts all code execution. idle mode halts the cpu and code execution, but allows peripheral modules to continue operation. the assembler syntax of the pwrsav instruction is shown in example 9-1 . sleep and idle modes can be exited as a result of an enabled interrupt, wdt time-out or a device reset. when the device exits these modes, it is said to wake-up. example 9-1: pwrsav instruction syntax note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?watchdog timer and power-saving modes? (ds70615) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ) 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: sleep_mode and idle_mode are con- stants defined in the assembler include file for the selected device. pwrsav #sleep_mode ; put the device into sleep mode pwrsav #idle_mode ; put the device into idle mode downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 100 7 2015-2016 microchip technology inc. 9.2.1 sleep mode the following occur in sleep mode: the system clock source is shut down. if an on-chip oscillator is used, it is turned off. the device current consumption is reduced to a minimum, provided that no i/o pin is sourcing current. the fail-safe clock monitor does not operate, since the system clock source is disabled. the lprc clock continues to run in sleep mode if the wdt is enabled. the wdt, if enabled, is automatically cleared prior to entering sleep mode. some device features or peripherals can continue to operate. this includes items such as the input change notification on the i/o ports, or peripherals that use an external clock input. any peripheral that requires the system clock source for its operation is disabled. the device wakes up from sleep mode on any of the these events: any interrupt source that is individually enabled any form of device reset a wdt time-out on wake-up from sleep mode, the processor restarts with the same clock source that was active when sleep mode was entered. for optimal power savings, the internal regulator and the flash regulator can be configured to go into stand- by when sleep mode is entered by clearing the vregs (rcon<8>) and vregsf (rcon<11>) bits (default configuration). if the application requires a faster wake-up time, and can accept higher current requirements, the vregs (rcon<8>) and vregsf (rcon<11>) bits can be set to keep the internal regulator and the flash regulator active during sleep mode. 9.2.2 idle mode the following occur in idle mode: the cpu stops executing instructions. the wdt is automatically cleared. the system clock source remains active. by default, all peripheral modules continue to operate normally from the system clock source, but can also be selectively disabled (see section 9.4 ?peripheral module disable? ). if the wdt or fscm is enabled, the lprc also remains active. the device wakes from idle mode on any of these events: any interrupt that is individually enabled any device reset a wdt time-out on wake-up from idle mode, the clock is reapplied to the cpu and instruction execution will begin (2-4 clock cycles later), starting with the instruction following the pwrsav instruction or the first instruction in the isr. all peripherals also have the option to discontinue operation when idle mode is entered to allow for increased power savings. this option is selectable in the control register of each peripheral (for example, the tsidl bit in the timer1 control register (t1con<13>). 9.2.3 interrupts coincident with power save instructions any interrupt that coincides with the execution of a pwrsav instruction is held off until entry into sleep or idle mode has completed. the device then wakes up from sleep or idle mode. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 101 dspic33epxxgs202 family 9.3 doze mode the preferred strategies for reducing power consump- tion are changing clock speed and invoking one of the power-saving modes. in some circumstances, this cannot be practical. for example, it may be necessary for an application to maintain uninterrupted synchronous communication, even while it is doing nothing else. reducing system clock speed can introduce communi- cation errors, while using a power-saving mode can stop communications completely. doze mode is a simple and effective alternative method to reduce power consumption while the device is still executing code. in this mode, the system clock continues to operate from the same source and at the same speed. peripheral modules continue to be clocked at the same speed, while the cpu clock speed is reduced. synchronization between the two clock domains is maintained, allowing the peripherals to access the sfrs while the cpu executes code at a slower rate. doze mode is enabled by setting the dozen bit (clkdiv<11>). the ratio between peripheral and core clock speed is determined by the doze<2:0> bits (clkdiv<14:12>). there are eight possible configu- rations, from 1:1 to 1:128, with 1:1 being the default setting. programs can use doze mode to selectively reduce power consumption in event-driven applications. this allows clock-sensitive functions, such as synchronous communications, to continue without interruption while the cpu idles, waiting for something to invoke an inter- rupt routine. an automatic return to full-speed cpu operation on interrupts can be enabled by setting the roi bit (clkdiv<15>). by default, interrupt events have no effect on doze mode operation. 9.4 peripheral module disable the peripheral module disable (pmd) registers provide a method to disable a peripheral module by stopping all clock sources supplied to that module. when a peripheral is disabled using the appropriate pmdx control bit, the peripheral is in a minimum power consumption state. the control and status registers associated with the peripheral are also disabled, so writes to those registers do not have any effect and read values are invalid. a peripheral module is enabled only if both the associ- ated bit in the pmdx register is cleared and the peripheral is supported by the specific dspic ? dsc variant. if the peripheral is present in the device, it is enabled in the pmd register by default. 9.5 power-saving resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 9.5.1 key resources ?watchdog timer and power-saving modes? (ds70615) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools note: if a pmdx bit is set, the corresponding module is disabled after a delay of one instruction cycle. similarly, if a pmdx bit is cleared, the corresponding module is enabled after a delay of one instruction cycle (assuming the module control regis- ters are already configured to enable module operation). downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 102 7 2015-2016 microchip technology inc. register 9-1: pmd1: peripheral mo dule disable control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 u-0 t3md t2md t1md pwmmd bit 15 bit 8 r/w-0 u-0 r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 i2c1md u 1 m d spi1md adcmd bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13 t3md: timer3 module disable bit 1 = timer3 module is disabled 0 = timer3 module is enabled bit 12 t2md: timer2 module disable bit 1 = timer2 module is disabled 0 = timer2 module is enabled bit 11 t1md: timer1 module disable bit 1 = timer1 module is disabled 0 = timer1 module is enabled bit 10 unimplemented: read as 0 bit 9 pwmmd: pwm module disable bit 1 = pwm module is disabled 0 = pwm module is enabled bit 8 unimplemented: read as 0 bit 7 i2c1md: i2c1 module disable bit 1 = i2c1 module is disabled 0 = i2c1 module is enabled bit 6 unimplemented: read as 0 bit 5 u1md: uart1 module disable bit 1 = uart1 module is disabled 0 = uart1 module is enabled bit 4 unimplemented: read as 0 bit 3 spi1md: spi1 module disable bit 1 = spi1 module is disabled 0 = spi1 module is enabled bit 2-1 unimplemented: read as 0 bit 0 adcmd: adc module disable bit 1 = adc module is disabled 0 = adc module is enabled downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 103 dspic33epxxgs202 family register 9-3: pmd3: peripheral mo dule disable control register 3 register 9-2: pmd2: peripheral mo dule disable control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 i c 1 m d bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 o c 1 m d bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-9 unimplemented: read as 0 bit 8 ic1md: input capture 1 module disable bit 1 = input capture 1 module is disabled 0 = input capture 1 module is enabled bit 7-1 unimplemented: read as 0 bit 0 oc1md: output compare 1 module disable bit 1 = output compare 1 module is disabled 0 = output compare 1 module is enabled u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 c m p m d bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as 0 bit 10 cmpmd: comparator module disable bit 1 = comparator module is disabled 0 = comparator module is enabled bit 9-0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 104 7 2015-2016 microchip technology inc. register 9-4: pmd6: peripheral mo dule disable control register 6 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 pwm3md pwm2md pwm1md bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as 0 bit 10 pwm3md: pwm3 module disable bit 1 = pwm3 module is disabled 0 = pwm3 module is enabled bit 9 pwm2md: pwm2 module disable bit 1 = pwm2 module is disabled 0 = pwm2 module is enabled bit 8 pwm1md: pwm1 module disable bit 1 = pwm1 module is disabled 0 = pwm1 module is enabled bit 7-0 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 105 dspic33epxxgs202 family register 9-5: pmd7: peripheral mo dule disable control register 7 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 c m p 2 m dc m p 1 m d bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 p g a 1 m d bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as 0 bit 9 cmp2md: comparator channel 2 (cmp2) module disable bit 1 = cmp2 module is disabled 0 = cmp2 module is enabled bit 8 cmp1md: comparator channel 1 (cmp1) module disable bit 1 = cmp1 module is disabled 0 = cmp1 module is enabled bit 7-2 unimplemented: read as 0 bit 1 pga1md: pga1 module disable bit 1 = pga1 module is disabled 0 = pga1 module is enabled bit 0 unimplemented: read as 0 register 9-6: pmd8: peripheral mo dule disable control register 8 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 u-0 p g a 2 m d bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-11 unimplemented: read as 0 bit 10 pga2md: pga2 module disable bit 1 = pga2 module is disabled 0 = pga2 module is enabled bit 9-0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 106 7 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 107 dspic33epxxgs202 family 10.0 i/o ports many of the device pins are shared among the peripherals and the parallel i/o ports. all i/o input ports feature schmitt trigger inputs for improved noise immunity. 10.1 parallel i/o (pio) ports generally, a parallel i/o port that shares a pin with a peripheral is subservient to the peripheral. the peripherals output buffer data and control signals are provided to a pair of multiplexers. the multiplexers select whether the peripheral or the associated port has ownership of the output data and control signals of the i/o pin. the logic also prevents loop through, in which a ports digital output can drive the input of a peripheral that shares the same pin. figure 10-1 illus- trates how ports are shared with other peripherals and the associated i/o pin to which they are connected. when a peripheral is enabled and the peripheral is actively driving an associated pin, the use of the pin as a general purpose output pin is disabled. the i/o pin can be read, but the output driver for the parallel port bit is disabled. if a peripheral is enabled, but the peripheral is not actively driving a pin, that pin can be driven by a port. all port pins have eight registers directly associated with their operation as digital i/os. the data direction register (trisx) determines whether the pin is an input or an out- put. if the data direction bit is a 1 , then the pin is an input. all port pins are defined as inputs after a reset. reads from the latch (latx), read the latch. writes to the latch, write the latch. reads from the port (portx) read the port pins, while writes to the port pins write the latch. any bit and its associated data and control registers that are not valid for a particular device are disabled. this means the corresponding latx and trisx registers, and the port pin are read as zeros. when a pin is shared with another peripheral or func- tion that is defined as an input only, it is nevertheless regarded as a dedicated port because there is no other competing source of outputs. figure 10-1: block diag ram of a typical shared port structure note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?i/o ports? (ds70000598) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. q d ck wr latx + trisx latch i/o pin wr portx data bus q d ck data latch read portx read trisx 10 1 0 wr trisx peripheral output data output enable peripheral input data i/o peripheral module peripheral output enable pio module output multiplexers output data input data peripheral module enable read latx downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 108 ? 2015-2016 microchip technology inc. 10.1.1 open-drain configuration in addition to the portx, latx and trisx registers for data control, port pins can also be individually configured for either digital or open-drain output. this is controlled by the open-drain control register, odcx, associated with each port. setting any of the bits configures the corresponding pin to act as an open-drain output. the open-drain feature allows the generation of out- puts other than v dd by using external pull-up resistors. the maximum open-drain voltage allowed on any pin is the same as the maximum v ih specification for that particular pin. see the ?pin diagrams? section for the available 5v tolerant pins and tab le 2 5- 11 for the maximum v ih specification for each pin. 10.2 configuring analog and digital port pins the anselx register controls the operation of the analog port pins. the port pins that are to function as analog inputs or outputs must have their corresponding anselx and trisx bits set. in order to use port pins for i/o functionality with digital modules, such as timers, uart, etc., the corresponding anselx bit must be cleared. the anselx register has a default value of 0xffff; therefore, all pins that share analog functions are analog (not digital) by default. pins with analog functions affected by the anselx registers are listed with a buffer type of analog in the pinout i/o descriptions (see table 1-1 ). if the trisx bit is cleared (output) while the anselx bit is set, the digital output level (v oh or v ol ) is converted by an analog peripheral, such as the adc module or comparator module. when the portx register is read, all pins configured as analog input channels are read as cleared (a low level). pins configured as digital inputs do not convert an analog input. analog levels on any pin, defined as a digital input (including the anx pins), can cause the input buffer to consume current that exceeds the device specifications. 10.2.1 i/o port write/read timing one instruction cycle is required between a port direction change or port write operation and a read operation of the same port. typically, this instruction would be a nop , as shown in example 10-1 . 10.3 input change notification (icn) the input change notification function of the i/o ports allows devices to generate interrupt requests to the processor in response to a change-of-state (cos) on selected input pins. this feature can detect input change-of-states even in sleep mode, when the clocks are disabled. every i/o port pin can be selected (enabled) for generating an interrupt request on a change-of-state. three control registers are associated with the icn functionality of each i/o port. the cnenx registers contain the icn interrupt enable control bits for each of the input pins. setting any of these bits enables an icn interrupt for the corresponding pins. each i/o pin also has a weak pull-up and a weak pull-down connected to it. the pull-ups and pull- downs act as a current source, or sink source, connected to the pin, and eliminate the need for external resistors when push button or keypad devices are connected. the pull-ups and pull-downs are enabled separately, using the cnpux and the cnpdx registers, which contain the control bits for each of the pins. setting any of the control bits enables the weak pull-ups and/or pull-downs for the corresponding pins. example 10-1: port write/read note: pull-ups and pull-downs on input change notification pins should always be disabled when the port pin is configured as a digital output. mov 0xff00, w0 ; configure portb<15:8> ; as inputs mov w0, trisb ; and portb<7:0> ; as outputs nop ; delay 1 cycle btss portb, #13 ; next instruction downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 109 dspic33epxxgs202 family 10.4 peripheral pin select (pps) a major challenge in general purpose devices is providing the largest possible set of peripheral features while minimizing the conflict of features on i/o pins. the challenge is even greater on low pin count devices. in an application where more than one peripheral needs to be assigned to a single pin, inconvenient work arounds in application code, or a complete redesign, may be the only option. peripheral pin select configuration provides an alter- native to these choices by enabling peripheral set selection and their placement on a wide range of i/o pins. by increasing the pinout options available on a particular device, users can better tailor the device to their entire application, rather than trimming the application to fit the device. the peripheral pin select configuration feature operates over a fixed subset of digital i/o pins. users may independently map the input and/or output of most digital peripherals to any one of these i/o pins. hard- ware safeguards are included that prevent accidental or spurious changes to the peripheral mapping once it has been established. 10.4.1 available pins the number of available pins is dependent on the particular device and its pin count. pins that support the peripheral pin select feature include the label, rpn, in their full pin designation, where n is the remappable pin number. rpn is used to designate pins that support both remappable input and output functions. 10.4.2 available peripherals the peripherals managed by the peripheral pin select are all digital only peripherals. these include general serial communications (uart and spi), general pur- pose timer clock inputs, timer-related peripherals (input capture and output compare) and interrupt-on-change inputs. in comparison, some digital only peripheral modules are never included in the peripheral pin select feature. this is because the peripherals function requires special i/o circuitry on a specific port and cannot be easily connected to multiple pins. one example includes i 2 c modules. a similar requirement excludes all modules with analog inputs, such as the adc converter. a key difference between remappable and non- remappable peripherals is that remappable peripherals are not associated with a default i/o pin. the peripheral must always be assigned to a specific i/o pin before it can be used. in contrast, non-remappable peripherals are always available on a default pin, assuming that the peripheral is active and not conflicting with another peripheral. when a remappable peripheral is active on a given i/o pin, it takes priority over all other digital i/os and digital communication peripherals associated with the pin. priority is given regardless of the type of peripheral that is mapped. remappable peripherals never take priority over any analog functions associated with the pin. 10.4.3 controlling peripheral pin select peripheral pin select features are controlled through two sets of sfrs: one to map peripheral inputs and one to map outputs. because they are separately con- trolled, a particular peripherals input and output (if the peripheral has both) can be placed on any selectable function pin without constraint. the association of a peripheral to a peripheral- selectable pin is handled in two different ways, depending on whether an input or output is being mapped. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 110 ? 2015-2016 microchip technology inc. 10.4.4 input mapping the inputs of the peripheral pin select options are mapped on the basis of the peripheral. that is, a control register associated with a peripheral dictates the pin it will be mapped to. the rpinrx registers are used to configure peripheral input mapping (see register 10-1 through register 10-15 ). each register contains sets of 8-bit fields, with each set associated with one of the remappable peripherals. programming a given periph- erals bit field with an appropriate 8-bit value maps the rpn pin with the corresponding value to that peripheral. for any given device, the valid range of values for any bit field corresponds to the maximum number of peripheral pin selections supported by the device. for example, figure 10-2 illustrates remappable pin selection for the u1rx input. figure 10-2: remappable input for u1rx 10.4.4.1 virtual connections the dspic33epxxgs202 devices support six virtual rpn pins (rp176-rp181), which are identical in functionality to all other rpn pins, with the exception of pinouts. these six pins are internal to the devices and are not connected to a physical device pin. these pins provide a simple way for inter-peripheral connection without utilizing a physical pin. for example, the output of the analog comparator can be connected to rp176 and the pwm fault input can be configured for rp176 as well. this configuration allows the analog comparator to trigger pwm faults without the use of an actual physical pin on the device. rp0 rp1 rp2 0 12 u1rx input u1rxr<7:0> to peripheral rpn n note: for input only, peripheral pin select functionality does not have priority over trisx settings. therefore, when configuring an rpn pin for input, the corresponding bit in the trisx register must also be configured for input (set to 1 ). downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 111 dspic33epxxgs202 family table 10-1: selectable input sources (maps input to function) input name ( 1 ) function name register configuration bits external interrupt 1 int1 rpinr0 int1r<7:0> external interrupt 2 int2 rpinr1 int2r<7:0> timer1 external clock t1ck rpinr2 t1ckr<7:0> timer2 external clock t2ck rpinr3 t2ckr<7:0> timer3 external clock t3ck rpinr3 t3ckr<7:0> input capture 1 ic1 rpinr7 ic1r<7:0> output compare fault a ocfa rpinr11 ocfar<7:0> pwm fault 1 flt1 rpinr12 flt1r<7:0> pwm fault 2 flt2 rpinr12 flt2r<7:0> pwm fault 3 flt3 rpinr13 flt3r<7:0> pwm fault 4 flt4 rpinr13 flt4r<7:0> uart1 receive u1rx rpinr18 u1rxr<7:0> uart1 clear-to-send u1cts rpinr18 u1ctsr<7:0> spi1 data input sdi1 rpinr20 sdi1r<7:0> spi1 clock input sck1 rpinr20 sck1r<7:0> spi1 slave select ss 1 rpinr21 ss1r<7:0> pwm synchronous input 1 synci1 rpinr37 synci1r<7:0> pwm synchronous input 2 synci2 rpinr38 synci2r<7:0> pwm fault 5 flt5 rpinr42 flt5r<7:0> pwm fault 6 flt6 rpinr42 flt6r<7:0> pwm fault 7 flt7 rpinr43 flt7r<7:0> pwm fault 8 flt8 rpinr43 flt8r<7:0> note 1: unless otherwise noted, all inputs use the schmitt trigger input buffers. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 112 ? 2015-2016 microchip technology inc. 10.4.5 output mapping in contrast to inputs, the outputs of the peripheral pin select options are mapped on the basis of the pin. in this case, a control register associated with a particular pin dictates the peripheral output to be mapped. the rporx registers are used to control output mapping. each register contains sets of 6-bit fields, with each set associ- ated with one rpn pin (see register 10-16 through register 10-26 ). the value of the bit field corresponds to one of the peripherals and that peripherals output is mapped to the pin (see ta b l e 1 0 - 2 and figure 10-3 ). a null output is associated with the output register reset value of 0 . this is done to ensure that remap- pable outputs remain disconnected from all output pins by default. figure 10-3: multiplexing remappable outputs for rpn 10.4.5.1 mapping limitations the control schema of the peripheral select pins is not limited to a small range of fixed peripheral configura- tions. there are no mutual or hardware-enforced lockouts between any of the peripheral mapping sfrs. literally any combination of peripheral mappings across any or all of the rpn pins is possible. this includes both many-to-one and one-to-many mappings of peripheral inputs, and outputs to pins. while such mappings may be technically possible from a configu- ration point of view, they may not be supportable from an electrical point of view. rpnr<5:0> 046 1 default u1tx output u1rts output 2 synco2 output 45 synco1 output output data rpn table 10-2: output selection for remappable pins (rpn) function rpnr<5:0> output name default port 000000 rpn tied to default pin u1tx 000001 rpn tied to uart1 transmit u1rts /bclk 000010 rpn tied to uart1 request-to-send sdo1 000101 rpn tied to spi1 data output sck1 000110 rpn tied to spi1 clock output ss1 000111 rpn tied to spi1 slave select oc1 010000 rpn tied to output compare 1 output acmp1 011000 rpn tied to analog comparator 1 output acmp2 011001 rpn tied to analog comparator 2 output synco1 101101 rpn tied to pwm primary master time base sync output synco2 101110 rpn tied to pwm secondary master time base sync output downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 113 dspic33epxxgs202 family 10.5 i/o helpful tips 1. in some cases, certain pins, as defined in table 25-11 under injection current, have internal protection diodes to v dd and v ss . the term, injection current, is also referred to as clamp current. on designated pins, with sufficient exter- nal current-limiting precautions by the user, i/o pin input voltages are allowed to be greater or less than the data sheet absolute maximum ratings, with respect to the v ss and v dd supplies. note that when the user application forward biases either of the high or low side internal input clamp diodes, that the resulting current being injected into the device, that is clamped internally by the v dd and v ss power rails, may affect the adc accuracy by four to six counts. 2. i/o pins that are shared with any analog input pin (i.e., anx) are always analog pins by default after any reset. consequently, configuring a pin as an analog input pin automatically disables the digital input pin buffer and any attempt to read the digital input level by reading portx or latx will always return a 0 , regardless of the digital logic level on the pin. to use a pin as a digital i/o pin on a shared anx pin, the user application needs to configure the analog pin configuration registers in the i/o ports module (i.e., anselx) by setting the appropriate bit that corresponds to that i/o port pin to a 0 . 3. most i/o pins have multiple functions. referring to the device pin diagrams in this data sheet, the prior- ities of the functions allocated to any pins are indicated by reading the pin name from left-to-right. the left most function name takes precedence over any function to its right in the naming convention. for example: an16/t2ck/t7ck/rc1. this indi- cates that an16 is the highest priority in this example and will supersede all other functions to its right in the list. those other functions to its right, even if enabled, would not work as long as any other function to its left was enabled. this rule applies to all of the functions listed for a given pin. 4. each pin has an internal weak pull-up resistor and pull-down resistor that can be configured using the cnpux and cnpdx registers, respectively. these resistors eliminate the need for external resistors in certain applications. the internal pull-up is up to ~(v dd C 0.8), not v dd . this value is still above the minimum v ih of cmos and ttl devices. 5. when driving leds directly, the i/o pin can source or sink more current than what is specified in the v oh /i oh and v ol /i ol dc characteristics specifica- tion. the respective i oh and i ol current rating only applies to maintaining the corresponding output at or above the v oh , and at or below the v ol levels. however, for leds, unlike digital inputs of an exter- nally connected device, they are not governed by the same minimum v ih /v il levels. an i/o pin output can safely sink or source any current less than that listed in the absolute maximum ratings in section 25.0 ?electrical characteristics? of this data sheet. for example: v oh = 2.4v @ i oh = -8 ma and v dd = 3.3v the maximum output current sourced by any 8 ma i/o pin = 12 ma. led source current < 12 ma is technically permitted. note: although it is not possible to use a digital input pin when its analog function is enabled, it is possible to use the digital i/o output function, trisx = 0x0, while the analog function is also enabled. however, this is not recommended, particularly if the analog input is connected to an external analog voltage source, which would create signal contention between the analog signal and the output pin driver. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 114 ? 2015-2016 microchip technology inc. 6. the peripheral pin select (pps) pin mapping rules are as follows: a) only one output function can be active on a given pin at any time, regardless if it is a dedicated or remappable function (one pin, one output). b) it is possible to assign a remappable output function to multiple pins and externally short or tie them together for increased current drive. c) if any dedicated output function is enabled on a pin, it will take precedence over any remappable output function. d) if any dedicated digital (input or output) function is enabled on a pin, any number of input remappable functions can be mapped to the same pin. e) if any dedicated analog function(s) are enabled on a given pin, digital input(s) of any kind will all be disabled, although a single digital output, at the users caution- ary discretion, can be enabled and active as long as there is no signal contention with an external analog input signal. for example, it is possible for the adc to convert the digital output logic level, or to toggle a digital out- put on a comparator or adc input, provided there is no external analog input, such as for a built-in self-test. f) any number of input remappable functions can be mapped to the same pin(s) at the same time, including to any pin with a single output from either a dedicated or remappable output. g) the trisx registers control only the digital i/o output buffer. any other dedicated or remappable active output will automatically override the trisx setting. the trisx reg- ister does not control the digital logic input buffer. remappable digital inputs do not automatically override trisx set- tings, which means that the trisx bit must be set to input for pins with only remappable input function(s) assigned. h) all analog pins are enabled by default after any reset and the corresponding digital input buffer on the pin has been disabled. only the analog pin select (anselx) registers control the digital input buffer, not the trisx register. the user must disable the analog function on a pin using the analog pin select registers in order to use any digital input(s) on a corresponding pin, no exceptions. 10.6 i/o ports resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 10.6.1 key resources ?i/o ports? (ds70000598) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 115 dspic33epxxgs202 family 10.7 peripheral pin select registers register 10-1: rpinr0: peripheral pin select input register 0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 int1r<7:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 int1r<7:0>: assign external interrupt 1 (int1) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 unimplemented: read as 0 register 10-2: rpinr1: peripheral pin select input register 1 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 int2r<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 int2r<7:0>: assign external interrupt 2 (int2) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 116 ? 2015-2016 microchip technology inc. register 10-3: rpinr2: peripheral pin select input register 2 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t1ckr<7:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 t1ckr<7:0>: assign timer1 external clock (t1ck) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 117 dspic33epxxgs202 family register 10-4: rpinr3: peripheral pin select input register 3 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t3ckr7 t3ckr6 t3ckr5 t3ckr4 t3ckr3 t3ckr2 t3ckr1 t3ckr0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 t2ckr7 t2ckr6 t2ckr5 t2ckr4 t2ckr3 t2ckr2 t2ckr1 t2ckr0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 t3ckr<7:0>: assign timer3 external clock (t3ck) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 0000001 = input tied to rp1 0000000 = input tied to v ss bit 7-0 t2ckr<7:0>: assign timer2 external clock (t2ck) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 118 ? 2015-2016 microchip technology inc. register 10-5: rpinr7: peripheral pin select input register 7 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ic1r<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 ic1r<7:0>: assign input capture 1 (ic1) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss register 10-6: rpinr11: peripheral pin select input register 11 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ocfar<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 ocfar<7:0>: assign output compare fault a (ocfa) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 119 dspic33epxxgs202 family register 10-7: rpinr12: peripheral pin select input register 12 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt2r7 flt2r6 flt2r5 flt2r4 flt2r3 flt2r2 flt2r1 flt2r0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt1r7 flt1r6 flt1r5 flt1r4 flt1r3 flt1r2 flt1r1 flt1r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 flt2r<7:0>: assign pwm fault 2 (flt2) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 flt1r<7:0>: assign pwm fault 1 (flt1) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 120 ? 2015-2016 microchip technology inc. register 10-8: rpinr13: peripheral pin select input register 13 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt4r7 flt4r6 flt4r5 flt4r4 flt4r3 flt4r2 flt4r1 flt4r0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt3r7 flt3r6 flt3r5 flt3r4 flt3r3 flt3r2 flt3r1 flt3r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 flt4r<7:0>: assign pwm fault 4 (flt4) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 flt3r<7:0>: assign pwm fault 3 (flt3) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 121 dspic33epxxgs202 family register 10-9: rpinr18: peripheral pin select input register 18 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u1ctsr7 u1ctsr6 u1ctsr5 u1ctsr4 u1ctsr3 u1ctsr2 u1ctsr1 u1ctsr0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u1rxr7 u1rxr6 u1rxr5 u1rxr4 u1rxr3 u1rxr2 u1rxr1 u1rxr0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 u1ctsr<7:0>: assign uart1 clear-to-send (u1 cts ) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 u1rxr<7:0>: assign uart1 receive (u1rx) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 122 ? 2015-2016 microchip technology inc. register 10-10: rpinr20: peripheral pin select input register 20 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sck1inr7 sck1inr6 sck1inr5 sck1inr4 sck1inr3 sck1inr2 sck1inr1 sck1inr0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sdi1r7 sdi1r6 sdi1r5 sdi1r4 sdi1r3 sdi1r2 sdi1r1 sdi1r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 sck1inr<7:0>: assign spi1 clock input (sck1) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 sdi1r<7:0>: assign spi1 data input (sdi1) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 123 dspic33epxxgs202 family register 10-11: rpinr21: peripheral pin select input register 21 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ss1r<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 ss1r<7:0>: assign spi1 slave select (ss 1 ) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss register 10-12: rpinr37: peripheral pin select input register 37 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 synci1r<7:0> bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 synci1r<7:0>: assign pwm synchronization input 1 to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 124 ? 2015-2016 microchip technology inc. register 10-13: rpinr38: peripheral pin select input register 38 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 synci2r<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7-0 synci2r<7:0>: assign pwm synchronization input 2 to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 125 dspic33epxxgs202 family register 10-14: rpinr42: peripheral pin select input register 42 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt6r7 flt6r6 flt6r5 flt6r4 flt6r3 flt6r2 flt6r1 flt6r0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt5r7 flt5r6 flt5r5 flt5r4 flt5r3 flt5r2 flt5r1 flt5r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 flt6r<7:0>: assign pwm fault 6 (flt6) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 flt5r<7:0>: assign pwm fault 5 (flt5) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 126 ? 2015-2016 microchip technology inc. register 10-15: rpinr43: peripheral pin select input register 43 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt8r7 flt8r6 flt8r5 flt8r4 flt8r3 flt8r2 flt8r1 flt8r0 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flt7r7 flt7r6 flt7r5 flt7r4 flt7r3 flt7r2 flt7r1 flt7r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 flt8r<7:0>: assign pwm fault 8 (flt8) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss bit 7-0 flt7r<7:0>: assign pwm fault 7 (flt7) to the corresponding rpn pin bits 10110101 = input tied to rp181 10110100 = input tied to rp180 00000001 = input tied to rp1 00000000 = input tied to v ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 127 dspic33epxxgs202 family register 10-16: rpor0: peripheral pin select output register 0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp33r5 rp33r4 rp33r3 rp33r2 rp33r1 rp33r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp32r5 rp32r4 rp32r3 rp32r2 rp32r1 rp32r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp33r<5:0>: peripheral output function is assigned to rp33 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp32r<5:0>: peripheral output function is assigned to rp32 output pin bits (see table 10-2 for peripheral function numbers) register 10-17: rpor1: peripheral pin select output register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp35r5 rp35r4 rp35r3 rp35r2 rp35r1 rp35r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp34r5 rp34r4 rp34r3 rp34r2 rp34r1 rp34r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp35r<5:0>: peripheral output function is assigned to rp35 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp34r<5:0>: peripheral output function is assigned to rp34 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 128 ? 2015-2016 microchip technology inc. register 10-18: rpor2: peripheral pin select output register 2 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp37r5 rp37r4 rp37r3 rp37r2 rp37r1 rp37r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp36r5 rp36r4 rp36r3 rp36r2 rp36r1 rp36r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp37r<5:0>: peripheral output function is assigned to rp37 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp36r<5:0>: peripheral output function is assigned to rp36 output pin bits (see table 10-2 for peripheral function numbers) register 10-19: rpor3: peripheral pin select output register 3 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp39r5 rp39r4 rp39r3 rp39r2 rp39r1 rp39r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp38r5 rp38r4 rp38r3 rp38r2 rp38r1 rp38r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp39r<5:0>: peripheral output function is assigned to rp39 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp38r<5:0>: peripheral output function is assigned to rp38 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 129 dspic33epxxgs202 family register 10-20: rpor4: peripheral pin select output register 4 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp41r5 rp41r4 rp41r3 rp41r2 rp41r1 rp41r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp40r5 rp40r4 rp40r3 rp40r2 rp40r1 rp40r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp41r<5:0>: peripheral output function is assigned to rp41 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp40r<5:0>: peripheral output function is assigned to rp40 output pin bits (see table 10-2 for peripheral function numbers) register 10-21: rpor5: peripheral pin select output register 5 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp43r5 rp43r4 rp43r3 rp43r2 rp43r1 rp43r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp42r5 rp42r4 rp42r3 rp42r2 rp42r1 rp42r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp43r<5:0>: peripheral output function is assigned to rp43 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp42r<5:0>: peripheral output function is assigned to rp42 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 130 ? 2015-2016 microchip technology inc. register 10-22: rpor6: peripheral pin select output register 6 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp45r5 rp45r4 rp45r3 rp45r2 rp45r1 rp45r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp44r5 rp44r4 rp44r3 rp44r2 rp44r1 rp44r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp45r<5:0>: peripheral output function is assigned to rp45 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp44r<5:0>: peripheral output function is assigned to rp44 output pin bits (see table 10-2 for peripheral function numbers) register 10-23: rpor7: peripheral pin select output register 7 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp47r5 rp47r4 rp47r3 rp47r2 rp47r1 rp47r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp46r5 rp46r4 rp46r3 rp46r2 rp46r1 rp46r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp47r<5:0>: peripheral output function is assigned to rp47 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp46r<5:0>: peripheral output function is assigned to rp46 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 131 dspic33epxxgs202 family register 10-24: rpor8: peripheral pin select output register 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp177r5 rp177r4 rp177r3 rp177r2 rp177r1 rp177r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp176r5 rp176r4 rp176r3 rp176r2 rp176r1 rp176r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp177r<5:0>: peripheral output function is assigned to rp177 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp176r<5:0>: peripheral output function is assigned to rp176 output pin bits (see table 10-2 for peripheral function numbers) register 10-25: rpor9: peripheral pin select output register 9 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp179r5 rp179r4 rp179r3 rp179r2 rp179r1 rp179r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp178r5 rp178r4 rp178r3 rp178r2 rp178r1 rp178r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp179r<5:0>: peripheral output function is assigned to rp179 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp178r<5:0>: peripheral output function is assigned to rp178 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 132 ? 2015-2016 microchip technology inc. register 10-26: rpor10: peripheral pin select output register 10 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp181r5 rp181r4 rp181r3 rp181r2 rp181r1 rp181r0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 rp180r5 rp180r4 rp180r3 rp180r2 rp180r1 rp180r0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-8 rp181r<5:0>: peripheral output function is assigned to rp181 output pin bits (see table 10-2 for peripheral function numbers) bit 7-6 unimplemented: read as 0 bit 5-0 rp180r<5:0>: peripheral output function is assigned to rp180 output pin bits (see table 10-2 for peripheral function numbers) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 133 dspic33epxxgs202 family 11.0 timer1 the timer1 module is a 16-bit timer that can operate as a free-running interval timer/counter. the timer1 module has the following unique features over other timers: can be operated in asynchronous counter mode from an external clock source the external clock input (t1ck) can optionally be synchronized to the internal device clock and the clock synchronization is performed after the prescaler a block diagram of timer1 is shown in figure 11-1 . the timer1 module can operate in one of the following modes: timer mode gated timer mode synchronous counter mode asynchronous counter mode in timer and gated timer modes, the input clock is derived from the internal instruction cycle clock (f cy ). in synchronous and asynchronous counter modes, the input clock is derived from the external clock input at the t1ck pin. the timer modes are determined by the following bits: timer clock source control bit (tcs): t1con<1> timer synchronization control bit (tsync): t1con<2> timer gate control bit (tgate): t1con<6> timer control bit settings for different operating modes are provided in table 11-1 . table 11-1: timer mode settings figure 11-1: 16-bit time r1 module block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?timers? (ds70362) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. mode tcs tgate tsync timer 00x gated timer 01x synchronous counter 1x1 asynchronous counter 1x0 tgate tcs 00 10 x1 pr1 tgate set t1if flag 0 1 tsync 1 0 sync equal reset t1ck tckps<1:0> gate sync f p (1) falling edge detect tckps<1:0> note 1: f p is the peripheral clock. latch data clk t1clk adc trigger tmr1 comparator prescaler (/n) prescaler (/n) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 134 ? 2015-2016 microchip technology inc. 11.1 timer1 resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 11.1.1 key resources ?timers? (ds70362) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 135 dspic33epxxgs202 family 11.2 timer1 control register register 11-1: t1con: timer1 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ( 1 ) t s i d l bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 u-0 tgate tckps1 tckps0 tsync ( 1 ) tcs ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 ton: timer1 on bit ( 1 ) 1 = starts 16-bit timer1 0 = stops 16-bit timer1 bit 14 unimplemented: read as 0 bit 13 tsidl: timer1 stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as 0 bit 6 tgate: timer1 gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timer1 input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 unimplemented: read as 0 bit 2 tsync: timer1 external clock input synchronization select bit ( 1 ) when tcs = 1 : 1 = synchronizes external clock input 0 = does not synchronize external clock input when tcs = 0 : this bit is ignored. bit 1 tcs: timer1 clock source select bit ( 1 ) 1 = external clock is from pin, t1ck (on the rising edge) 0 = peripheral clock (f p ) bit 0 unimplemented: read as 0 note 1: when timer1 is enabled in external synchronous counter mode (tcs = 1 , tsync = 1 , ton = 1 ), any attempts by user software to write to the tmr1 register are ignored. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 136 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 137 dspic33epxxgs202 family 12.0 timer2/3 the timer2/3 module is a 32-bit timer, which can also be configured as two independent 16-bit timers with selectable operating modes. as 32-bit timers, timer2 and timer3 operate in three modes: two independent 16-bit timers (e.g., timer2 and timer3) with all 16-bit operating modes (except asynchronous counter mode) single 32-bit timer single 32-bit synchronous counter they also support these features: timer gate operation selectable prescaler settings timer operation during idle and sleep modes interrupt on a 32-bit period register match time base for input capture and output compare modules (timer2 and timer3 only) individually, both of the 16-bit timers can function as synchronous timers or counters. they also offer the features listed previously, except for the event trigger; this is implemented only with timer2/3. the operating modes and enabled features are determined by setting the appropriate bit(s) in the t2con and t3con registers. t2con details are in register 12-1 . t3con details are in register 12-2 . for 32-bit timer/counter operation, timer2 is the least significant word (lsw); timer3 is the most significant word (msw) of the 32-bit timers. a block diagram for an example 32-bit timer pair (timer2/3) is shown in figure 12-2 . 12.1 timer resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 12.1.1 key resources ?timers? (ds70362) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?timers? (ds70362) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. note: for 32-bit operation, t3con control bits are ignored. only t2con control bits are used for setup and control. timer2 clock and gate inputs are utilized for the 32-bit timer modules, but an interrupt is generated with the timer3 interrupt flag. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 138 ? 2015-2016 microchip technology inc. figure 12-1: timerx block diagram (x = 2,3) figure 12-2: type b/type c timer pair block diagram (32-bit timer) note 1: f p is the peripheral clock. 2: the adc trigger is only available on tmr2. tgate tcs 00 10 x1 prx tgate set txif flag 0 1 equal reset txck tckps<1:0> gate sync f p (1) falling edge detect tckps<1:0> latch data clk txclk tmrx comparator prescaler (/n) prescaler (/n) sync adc trigger (2) tgate tcs 00 10x1 comparator tgate set tyif flag 0 1 equal reset txck tckps<1:0> f p (1) tckps<1:0> note 1: f p is the peripheral clock. 2: timerx is a type b timer (x = 2). 3: timery is a type c timer (y = 3). data clk prx tmryhld data bus<15:0> msw lsw prescaler (/n) prescaler (/n) sync gate sync falling edge detect pry tmrx (2) tmry (3) latch downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 139 dspic33epxxgs202 family 12.2 timer2/3 control registers register 12-1: t2con: timer2 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton t s i d l bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 u-0 tgate tckps1 tckps0 t32 t c s bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 ton: timer2 on bit when t32 = 1 : 1 = starts 32-bit timer2/3 0 = stops 32-bit timer2/3 when t32 = 0 : 1 = starts 16-bit timer2 0 = stops 16-bit timer2 bit 14 unimplemented: read as 0 bit 13 tsidl: timer2 stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as 0 bit 6 tgate: timer2 gated time accumulation enable bit when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timer2 input clock prescale select bits 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3 t32: 32-bit timer mode select bit 1 = timer2 and timer3 form a single 32-bit timer 0 = timer2 and timer3 act as two 16-bit timers bit 2 unimplemented: read as 0 bit 1 tcs: timer2 clock source select bit 1 = external clock is from pin, t2ck (on the rising edge) 0 = peripheral clock (f p ) bit 0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 140 ? 2015-2016 microchip technology inc. register 12-2: t3con: ti mer3 control register r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 ton ( 1 ) t s i d l ( 2 ) bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 u-0 u-0 r/w-0 u-0 t g a t e ( 1 ) tckps1 ( 1 ) tckps0 ( 1 ) t c s ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 ton: timer3 on bit ( 1 ) 1 = starts 16-bit timer3 0 = stops 16-bit timer3 bit 14 unimplemented: read as 0 bit 13 tsidl: timer3 stop in idle mode bit ( 2 ) 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-7 unimplemented: read as 0 bit 6 tgate: timer3 gated time accumulation enable bit ( 1 ) when tcs = 1 : this bit is ignored. when tcs = 0 : 1 = gated time accumulation is enabled 0 = gated time accumulation is disabled bit 5-4 tckps<1:0>: timer3 input clock prescale select bits ( 1 ) 11 = 1:256 10 = 1:64 01 = 1:8 00 = 1:1 bit 3-2 unimplemented: read as 0 bit 1 tcs: timer3 clock source select bit ( 1 ) 1 = external clock is from pin, t3ck (on the rising edge) 0 = peripheral clock (f p ) bit 0 unimplemented: read as 0 note 1: when 32-bit operation is enabled (t2con<3> = 1 ), these bits have no effect on timer3 operation; all timer functions are set through t2con. 2: when 32-bit timer operation is enabled (t32 = 1 ) in the timer2 control register (t2con<3>), the tsidl bit must be cleared to operate the 32-bit timer in idle mode. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 141 dspic33epxxgs202 family 13.0 input capture the input capture module is useful in applications requiring frequency (period) and pulse measurements. the dspic33epxxgs202 family devices support one input capture channel. key features of the input capture module include: hardware-configurable for 32-bit operation in all modes by cascading two adjacent modules synchronous and trigger modes of output compare operation, with up to 6 user-selectable trigger/sync sources available a 4-level fifo buffer for capturing and holding timer values for several events configurable interrupt generation up to four clock sources available, driving a separate internal 16-bit counter 13.1 input capture resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 13.1.1 key resources ?input capture with dedicated timer? (ds70000352) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections figure 13-1: input capture module block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?input capture with dedicated timer? (ds70000352) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. ic1buf 4-level fifo buffer ic1 pin icm<2:0> set ic1if edge detect logic ici<1:0> icov, icbne interrupt logic system bus prescaler counter 1:1/4/16 and clock synchronizer event and trigger and sync logic clock select ic1 clock sources trigger and sync sources ictsel<2:0> 16 16 16 ic1tmr increment reset note 1: the trigger/sync source is enabled by default and is set to timer3 as a source. this timer must be enabled for proper ic1 module operation or the trigger/sync source must be changed to another source option. syncsel<4:0> (1) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 142 ? 2015-2016 microchip technology inc. 13.2 input capture registers register 13-1: ic1con1: input capture control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 icsidl ictsel2 ictsel1 ictsel0 bit 15 bit 8 u-0 r/w-0 r/w-0 r-0, hc, hs r-0, hc, hs r/w-0 r/w-0 r/w-0 ici1 ici0 icov icbne icm2 icm1 icm0 bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13 icsidl: input capture stop in idle control bit 1 = input capture will halt in cpu idle mode 0 = input capture will continue to operate in cpu idle mode bit 12-10 ictsel<2:0>: input capture timer select bits 111 = peripheral clock (f p ) is the clock source of the ic1 110 = reserved 101 = reserved 100 = t1clk is the clock source of the ic1 (only the synchronous clock is supported) 011 = reserved 010 = reserved 001 = t2clk is the clock source of the ic1 000 = t3clk is the clock source of the ic1 bit 9-7 unimplemented: read as 0 bit 6-5 ici<1:0>: number of captures per interrupt select bits (this field is not used if icm<2:0> = 001 or 111 ) 11 = interrupt on every fourth capture event 10 = interrupt on every third capture event 01 = interrupt on every second capture event 00 = interrupt on every capture event bit 4 icov: input capture overflow status flag bit (read-only) 1 = input capture buffer overflow has occurred 0 = no input capture buffer overflow has occurred bit 3 icbne: input capture buffer not empty status bit (read-only) 1 = input capture buffer is not empty, at least one more capture value can be read 0 = input capture buffer is empty bit 2-0 icm<2:0>: input capture mode select bits 111 = input capture functions as an interrupt pin only in cpu sleep and idle modes (rising edge detect only, all other control bits are not applicable) 110 = unused (module is disabled) 101 = capture mode, every 16th rising edge (prescaler capture mode) 100 = capture mode, every 4th rising edge (prescaler capture mode) 011 = capture mode, every rising edge (simple capture mode) 010 = capture mode, every falling edge (simple capture mode) 001 = capture mode, every rising and falling edge (edge detect mode, (ici<1:0>) is not used in this mode) 000 = input capture is turned off downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 143 dspic33epxxgs202 family register 13-2: ic1con2: input capture control register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-0, hs u-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-1 ictrig ( 1 ) trigstat ( 2 ) syncsel4 ( 3 ) syncsel3 ( 3 ) syncsel2 ( 3 ) syncsel1 ( 3 ) syncsel0 ( 3 ) bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7 ictrig: input capture trigger operation select bit ( 1 ) 1 = input source used to trigger the input capture timer (trigger mode) 0 = input source used to synchronize the input capture timer to a timer of another module (synchronization mode) bit 6 trigstat: timer trigger status bit ( 2 ) 1 = ic1tmr has been triggered and is running 0 = ic1tmr has not been triggered and is being held clear bit 5 unimplemented: read as 0 note 1: the input source is selected by the syncsel<4:0> bits of the ic1con2 register. 2: this bit is set by the selected input source (selected by syncsel<4:0> bits); it can be read, set and cleared in software. 3: do not use the ic1 module as its own sync or trigger source. 4: this option should only be selected as a trigger source and not as a synchronization source. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 144 ? 2015-2016 microchip technology inc. bit 4-0 syncsel<4:0>: input source select for synchronization and trigger operation bits ( 3 ) 11111 = no sync or trigger source for ic1 11110 = reserved 11101 = reserved 11100 = reserved 11011 = reserved 11010 = reserved 11001 = cmp2 module synchronizes or triggers ic1 ( 4 ) 11000 = cmp1 module synchronizes or triggers ic1 ( 4 ) 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = reserved 10000 = reserved 01111 = reserved 01110 = reserved 01101 = timer3 synchronizes or triggers ic1 (default) 01100 = timer2 synchronizes or triggers ic1 01011 = timer1 synchronizes or triggers ic1 01010 = reserved 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = reserved 00100 = reserved 00011 = reserved 00010 = reserved 00001 = oc1 module synchronizes or triggers ic1 00000 = no sync or trigger source for ic1 register 13-2: ic1con2: input capture control register 2 (continued) note 1: the input source is selected by the syncsel<4:0> bits of the ic1con2 register. 2: this bit is set by the selected input source (selected by syncsel<4:0> bits); it can be read, set and cleared in software. 3: do not use the ic1 module as its own sync or trigger source. 4: this option should only be selected as a trigger source and not as a synchronization source. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 145 dspic33epxxgs202 family 14.0 output compare the output compare module can select one of four available clock sources for its time base. the module compares the value of the timer with the value of one or two compare registers, depending on the operating mode selected. the state of the output pin changes when the timer value matches the compare register value. the output compare module generates either a single output pulse, or a sequence of output pulses, by changing the state of the output pin on the compare match events. the output compare module can also generate interrupts on compare match events. 14.1 output compare resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 14.1.1 key resources ?output compare with dedicated timer? (ds70005159) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools figure 14-1: output comp are module block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?output compare with dedicated timer? (ds70005159) in the ?dspic33/pic24 family reference man- ual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. oc1r buffer oc1con1 oc1con2 oc1 interrupt oc1 pin oc1rs buffer comparator match match trigger and sync logic clock select increment reset oc1 clock sources trigger and sync sources reset match event ocfa oc1r oc1rs event event rollover rollover/reset rollover/reset oc1 synchronization/trigger event syncsel<4:0> trigger (1) note 1: the trigger/sync source is enabled by default and is set to timer2 as a source. this timer must be enabled for oc1 module operation or the trigger/sync source must be changed to another source option. oc1 output and fault logic comparator oc1tmr downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 146 ? 2015-2016 microchip technology inc. 14.2 output compare control registers register 14-1: oc1con1: output compare control register 1 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 ocsidl octsel2 octsel1 octsel0 bit 15 bit 8 r/w-0 u-0 u-0 r/w-0, hsc r/w-0 r/w-0 r/w-0 r/w-0 enflta ocflta trigmode ocm2 ocm1 ocm0 bit 7 bit 0 legend: hsc = hardware settable/clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13 ocsidl: output compare stop in idle mode control bit 1 = output compare halts in cpu idle mode 0 = output compare continues to operate in cpu idle mode bit 12-10 octsel<2:0>: output compare clock select bits 111 = peripheral clock (f p ) 110 = reserved 101 = reserved 100 = t1clk is the clock source of the oc1 (only the synchronous clock is supported) 011 = reserved 010 = reserved 001 = t3clk is the clock source of the oc1 000 = t2clk is the clock source of the oc1 bit 9-8 unimplemented: read as 0 bit 7 enflta: fault a input enable bit 1 = output compare fault a input (ocfa) is enabled 0 = output compare fault a input (ocfa) is disabled bit 6-5 unimplemented: read as 0 bit 4 ocflta: pwm fault a condition status bit 1 = pwm fault a condition on the ocfa pin has occurred 0 = no pwm fault a condition on the ocfa pin has occurred bit 3 trigmode: trigger status mode select bit 1 = trigstat (oc1con2<6>) is cleared when oc1rs = oc1tmr or in software 0 = trigstat is cleared only by software note 1: oc1r and oc1rs are double-buffered in pwm mode only. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 147 dspic33epxxgs202 family bit 2-0 ocm<2:0>: output compare mode select bits 111 = center-aligned pwm mode: output is set high when oc1tmr = oc1r and set low when oc1tmr = oc1rs ( 1 ) 110 = edge-aligned pwm mode: output is set high when oc1tmr = 0 and set low when oc1tmr = oc1r ( 1 ) 101 = double compare continuous pulse mode: initializes oc1 pin low, toggles oc1 state continuously on alternate matches of oc1r and oc1rs 100 = double compare single-shot mode: initializes oc1 pin low, toggles oc1 state on matches of oc1r and oc1rs for one cycle 011 = single compare mode: compare event with oc1r, continuously toggles oc1 pin 010 = single compare single-shot mode: initializes oc1 pin high, compare event with oc1r, forces oc1 pin low 001 = single compare single-shot mode: initializes oc1 pin low, compare event with oc1r, forces oc1 pin high 000 = output compare channel is disabled register 14-1: oc1con1: output compare control register 1 (continued) note 1: oc1r and oc1rs are double-buffered in pwm mode only. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 148 ? 2015-2016 microchip technology inc. register 14-2: oc1con2: output compare control register 2 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 fltmd fltout flttrien ocinv bit 15 bit 8 r/w-0 r/w-0, hs r/w-0 r/w-0 r/w-1 r/w-1 r/w-0 r/w-0 octrig trigstat octris syncsel4 syncsel3 syncsel2 syncsel1 syncsel0 bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 fltmd: fault mode select bit 1 = fault mode is maintained until the fault source is removed; the corresponding ocflta bit is cleared in software and a new pwm period starts 0 = fault mode is maintained until the fault source is removed and a new pwm period starts bit 14 fltout: fault out bit 1 = pwm output is driven high on a fault 0 = pwm output is driven low on a fault bit 13 flttrien: fault output state select bit 1 = oc1 pin is tri-stated on a fault condition 0 = oc1 pin i/o state is defined by the fltout bit on a fault condition bit 12 ocinv: output compare invert bit 1 = oc1 output is inverted 0 = oc1 output is not inverted bit 11-8 unimplemented: read as 0 bit 7 octrig: output compare trigger/sync select bit 1 = triggers oc1 from the source designated by the syncsel<4:0> bits 0 = synchronizes oc1 with the source designated by the syncsel<4:0> bits bit 6 trigstat: timer trigger status bit 1 = timer source has been triggered and is running 0 = timer source has not been triggered and is being held clear bit 5 octris: output compare output pin direction select bit 1 = output compare is tri-stated 0 = output compare module drives the ocx pin note 1: this option should only be selected as a trigger source and not as a synchronization source. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 149 dspic33epxxgs202 family bit 4-0 syncsel<4:0>: trigger/synchronization source selection bits 11111 = oc1rs compare event is used for synchronization 11110 = int2 pin synchronizes or triggers oc1 11101 = int1 pin synchronizes or triggers oc1 11100 = reserved 11011 = reserved 11010 = reserved 11001 = cmp2 module triggers oc1 ( 1 ) 11000 = cmp1 module triggers oc1 ( 1 ) 10111 = reserved 10110 = reserved 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = reserved 10000 = ic1 input capture interrupt event synchronizes or triggers oc1 01111 = reserved 01110 = reserved 01101 = timer3 synchronizes or triggers oc1 01100 = timer2 synchronizes or triggers oc1 (default) 01011 = timer1 synchronizes or triggers oc1 01010 = reserved 01001 = reserved 01000 = reserved 00111 = reserved 00110 = reserved 00101 = ic1 input capture event synchronizes or triggers oc1 00100 = reserved 00011 = reserved 00010 = reserved 00001 = reserved 00000 = no sync or trigger source for oc1 register 14-2: oc1con2: output compare control register 2 (continued) note 1: this option should only be selected as a trigger source and not as a synchronization source. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 150 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 151 dspic33epxxgs202 family 15.0 high-speed pwm the high-speed pwm module on dspic33epxxgs202 devices supports a wide variety of pwm modes and output formats. this pwm module is ideal for power conversion applications, such as: ac/dc converters dc/dc converters power factor correction uninterruptible power supply (ups) inverters battery chargers digital lighting 15.1 features overview the high-speed pwm module incorporates the following features: three pwm generators with two outputs per generator two master time base modules individual time base and duty cycle for each pwm output duty cycle, dead time, phase shift and a frequency resolution of 1.04 ns independent fault and current-limit inputs redundant output true independent output center-aligned pwm mode output override control chop mode (also known as gated mode) special event trigger dual trigger from pwm to analog-to-digital converter (adc) pwmxl and pwmxh output pin swapping independent pwmx frequency, duty cycle and phase-shift changes enhanced leading-edge blanking (leb) functionality pwmx capture functionality figure 15-1 conceptualizes the pwm module in a simplified block diagram. figure 15-2 illustrates how the module hardware is partitioned for each pwm output pair for the complementary pwm mode. the pwm module contains three pwm generators. the module has up to six pwm output pins: pwm1h/ pwm1l through pwm3h/pwm3l. for complementary outputs, these six i/o pins are grouped into high/low pairs. 15.2 feature description the pwm module is designed for applications that require: high resolution at high pwm frequencies the ability to drive standard, edge-aligned, center-aligned complementary and push-pull mode outputs the ability to create multiphase pwm outputs two common, medium power converter topologies are push-pull and half-bridge. these designs require the pwm output signal to be switched between alternate pins, as provided by the push-pull pwm mode. phase-shifted pwm describes the situation where each pwm generator provides outputs, but the phase relationship between the generator outputs is specifiable and changeable. multiphase pwm is often used to improve dc/dc converter load transient response, and reduce the size of output filter capacitors and inductors. multiple dc/dc converters are often operated in parallel, but phase shifted in time. a single pwm output operating at 250 khz has a period of 4 ? s, but an array of four pwm channels, staggered by 1 ? s each, yields an effective switching frequency of 1 mhz. multiphase pwm applications typically use a fixed-phase relationship. variable phase pwm is useful in zero voltage transition (zvt) power converters. here, the pwm duty cycle is always 50% and the power flow is controlled by varying the relative phase shift between the two pwm generators. note: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?high-speed pwm module? (ds70000323) in the ?dspic33/ pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). note: duty cycle, dead time, phase shift and frequency resolution is 8.32 ns in center-aligned pwm mode. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 152 ? 2015-2016 microchip technology inc. 15.2.1 write-protected registers on the dspic33epxxgs202 family devices, write protection is implemented for the ioconx and fclconx registers. the write protection feature prevents any inadvertent writes to these registers. this protection feature can be controlled by the pwmlock configuration bit (fdevopt<0>). the default state of the write protection feature is enabled (pwmlock = 1 ). the write protection feature can be disabled by configuring pwmlock = 0 . to gain write access to these locked registers, the user application must write two consecutive values (0xabcd and 0x4321) to the pwmkey register to perform the unlock operation. the write access to the ioconx or fclconx registers must be the next sfr access following the unlock process. there can be no other sfr accesses during the unlock process and subsequent write access. to write to both the ioconx and fclconx registers requires two unlock operations. the correct unlocking sequence is described in example 15-1 . example 15-1: pwm write-protec ted register unlock sequence 15.3 pwm resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 15.3.1 key resources ?high-speed pwm module? (ds70000323) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools ; writing to fclcon1 register requires unlock sequence mov #0xabcd, w10 ; load first unlock key to w10 register mov #0x4321, w11 ; load second unlock key to w11 register mov #0x0000, w0 ; load desired value of fclcon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0, fclcon1 ; write desired value to fclcon1 register ; set pwm ownership and polarity using the iocon1 register ; writing to iocon1 register requires unlock sequence mov #0xabcd, w10 ; load first unlock key to w10 register mov #0x4321, w11 ; load second unlock key to w11 register mov #0xf000, w0 ; load desired value of iocon1 register in w0 mov w10, pwmkey ; write first unlock key to pwmkey register mov w11, pwmkey ; write second unlock key to pwmkey register mov w0, iocon1 ; write desired value to iocon1 register downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 153 dspic33epxxgs202 family figure 15-1: high-speed pwm module architectural diagram cpu master time base syncix syncox pwm1h pwm1l pwm1 interrupt pwm2h pwm2l pwm2 interrupt pwm3h pwm3l pwm3 interrupt synchronization signal data bus adc module fault and fault, current-limit synchronization signal synchronization signal primary trigger secondary trigger special event trigger current-limit fault, current-limit primary and secondary pwm generator 3 pwm generator 2 pwm generator 1 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 154 ? 2015-2016 microchip technology inc. figure 15-2: simplified conceptual bl ock diagram of the high-speed pwm mux ptmrx pdcx pwmconx trgconx ptcon, ptcon2 ioconx dtrx pwmxl pwmxh fltx pwm1l pwm1h fclconx mdc phasex lebconx mux stmrx sdcx sphasex altdtrx pwmcapx user override logic current-limit pwm output mode control logic logic fault and current-limit logic pwm generator 1 fltx pwm generator 2 ? pwm generator 3 interrupt logic adc trigger module control and timing master duty cycle register synchronization synchronization master period master period master duty cycle master duty cycle secondary pwmx synci2 synci1 synco1 sevtcmp comparator special event trigger special event postscaler ptper pmtmr primary master time base master time base counter special event compare trigger comparator clock prescaler comparator comparator comparator 16-bit data bus dead-time trigx fault override logic override logic synco2 sevtcmp comparator special event trigger special event postscaler stper smtmr secondary master time base master time base counter special event compare trigger comparator clock prescaler stcon, stcon2 comparator strigx adc trigger pwmkey auxconx pin control logic downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 155 dspic33epxxgs202 family register 15-1: ptcon: pwm time base control register r/w-0 u-0 r/w-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 pten ptsidl sestat seien eipu ( 1 ) syncpol ( 1 ) syncoen ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 syncen ( 1 ) syncsrc2 ( 1 ) syncsrc1 ( 1 ) syncsrc0 ( 1 ) sevtps3 ( 1 ) sevtps2 ( 1 ) sevtps1 ( 1 ) sevtps0 ( 1 ) bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 pten: pwm module enable bit 1 = pwm module is enabled 0 = pwm module is disabled bit 14 unimplemented: read as 0 bit 13 ptsidl: pwm time base stop in idle mode bit 1 = pwm time base halts in cpu idle mode 0 = pwm time base runs in cpu idle mode bit 12 sestat: special event interrupt status bit 1 = special event interrupt is pending 0 = special event interrupt is not pending bit 11 seien: special event interrupt enable bit 1 = special event interrupt is enabled 0 = special event interrupt is disabled bit 10 eipu: enable immediate period updates bit ( 1 ) 1 = active period register is updated immediately 0 = active period register updates occur on pwm cycle boundaries bit 9 syncpol: synchronize input and output polarity bit ( 1 ) 1 = syncix/synco1 polarity is inverted (active-low) 0 = syncix/synco1 is active-high bit 8 syncoen: primary time base synchronization enable bit ( 1 ) 1 = synco1 output is enabled 0 = synco1 output is disabled bit 7 syncen: external time base synchronization enable bit ( 1 ) 1 = external synchronization of primary time base is enabled 0 = external synchronization of primary time base is disabled bit 6-4 syncsrc<2:0>: synchronous source selection bits ( 1 ) 111 = reserved 101 = reserved 100 = reserved 011 = reserved 010 = reserved 001 = synci2 000 = synci1 note 1: these bits should be changed only when pten = 0 . in addition, when using the syncix feature, the user application must program the period register with a value that is slightly lar ger than the expected period of the external synchronization input signal. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 156 ? 2015-2016 microchip technology inc. bit 3-0 sevtps<3:0>: pwm special event trigger output postscaler select bits ( 1 ) 1111 = 1:16 postscaler generates a special event trigger on every sixteenth compare match event 0001 = 1:2 postscaler generates a special event trigger on every second compare match event 0000 = 1:1 postscaler generates a special event trigger on every compare match event register 15-1: ptcon: pwm time base control register (continued) note 1: these bits should be changed only when pten = 0 . in addition, when using the syncix feature, the user application must program the period register with a value that is slightly la rger than the expected period of the external synchronization input signal. register 15-2: ptcon2: pwm clo ck divider select register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 pclkdiv<2:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 unimplemented: read as 0 bit 2-0 pclkdiv<2:0>: pwm input clock prescaler (divider) select bits ( 1 ) 111 = reserved 110 = divide-by-64, maximum pwm timing resolution 101 = divide-by-32, maximum pwm timing resolution 100 = divide-by-16, maximum pwm timing resolution 011 = divide-by-8, maximum pwm timing resolution 010 = divide-by-4, maximum pwm timing resolution 001 = divide-by-2, maximum pwm timing resolution 000 = divide-by-1, maximum pwm timing resolution (power-on default) note 1: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 157 dspic33epxxgs202 family register 15-3: ptper: pwm primary master time base period register ( 1 , 2 ) r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 ptper<15:8> bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 ptper<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 ptper<15:0>: primary master time base (pmtmr) period value bits note 1: the pwm time base has a minimum value of 0x0010 and a maximum value of 0xfff8. 2: any period value that is less than 0x0028 must have the least significant 3 bits set to 0 , thus yielding a period resolution at 8.32 ns (at fastest auxiliary clock rate). register 15-4: sevtcmp: pwm special event compare register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sevtcmp<12:5> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 sevtcmp<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 sevtcmp<12:0>: special event compare count value bits bit 2-0 unimplemented: read as 0 note 1: one lsb = 1.04 ns (at fastest auxiliary clock rate); therefore, the minimum sevtcmp resolution is 8.32 ns. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 158 ? 2015-2016 microchip technology inc. register 15-5: stcon: pw m secondary master time base control register u-0 u-0 u-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 sestat seien eipu ( 1 ) syncpol syncoen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 syncen syncsrc2 syncsrc1 syncsrc0 sevtps3 sevtps2 sevtps1 sevtps0 bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12 sestat: special event interrupt status bit 1 = secondary special event interrupt is pending 0 = secondary special event interrupt is not pending bit 11 seien: special event interrupt enable bit 1 = secondary special event interrupt is enabled 0 = secondary special event interrupt is disabled bit 10 eipu: enable immediate period updates bit ( 1 ) 1 = active secondary period register is updated immediately 0 = active secondary period register updates occur on pwm cycle boundaries bit 9 syncpol: synchronize input and output polarity bit 1 = syncix/synco2 polarity is inverted (active-low) 0 = syncix/synco2 polarity is active-high bit 8 syncoen: secondary master time base synchronization enable bit 1 = synco2 output is enabled. 0 = synco2 output is disabled bit 7 syncen: external secondary master time base synchronization enable bit 1 = external synchronization of secondary time base is enabled 0 = external synchronization of secondary time base is disabled bit 6-4 syncsrc<2:0>: secondary time base sync source selection bits 111 = reserved 101 = reserved 100 = reserved 011 = reserved 010 = reserved 001 = synci2 000 = synci1 bit 3-0 sevtps<3:0>: pwm secondary special event trigger output postscaler select bits 1111 = 1:16 postscale 0001 = 1:2 postscale 0000 = 1:1 postscale note 1: this bit only applies to the secondary master time base period. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 159 dspic33epxxgs202 family register 15-6: stcon2: pw m secondary clock divider select register 2 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 pclkdiv<2:0> ( 1 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 unimplemented: read as 0 bit 2-0 pclkdiv<2:0>: pwm input clock prescaler (divider) select bits ( 1 ) 111 = reserved 110 = divide-by-64, maximum pwm timing resolution 101 = divide-by-32, maximum pwm timing resolution 100 = divide-by-16, maximum pwm timing resolution 011 = divide-by-8, maximum pwm timing resolution 010 = divide-by-4, maximum pwm timing resolution 001 = divide-by-2, maximum pwm timing resolution 000 = divide-by-1, maximum pwm timing resolution (power-on default) note 1: these bits should be changed only when pten = 0 . changing the clock selection during operation will yield unpredictable results. register 15-7: stper: pwm secondary master time base period register ( 1 , 2 ) r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 stper<15:8> bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 stper<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 stper<15:0>: secondary master time base (smtmr) period value bits note 1: the pwm time base has a minimum value of 0x0010 and a maximum value of 0xfff8. 2: any period value that is less than 0x0028 must have the least significant 3 bits set to 0 , thus yielding a period resolution at 8.32 ns (at fastest auxiliary clock rate). downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 160 ? 2015-2016 microchip technology inc. register 15-8: ssevtcmp: pwm secondary special event compare register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ssevtcmp<12:5> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 ssevtcmp<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 ssevtcmp<12:0>: special event compare count value bits bit 2-0 unimplemented: read as 0 note 1: one lsb = 1.04 ns (at fastest auxiliary clock rate); therefore, the minimum sevtcmp resolution is 8.32 ns. register 15-9: chop: pwm cho p clock generator register ( 1 ) r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 chpclken chopclk6 chopclk5 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 chopclk4 chopclk3 chopclk2 chopclk1 chopclk0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 chpclken: enable chop clock generator bit 1 = chop clock generator is enabled 0 = chop clock generator is disabled bit 14-10 unimplemented: read as 0 bit 9-3 chopclk<6:0>: chop clock divider bits value is in 8.32 ns increments. the frequency of the chop clock signal is given by the following expression: chop frequency = 1/(16.64 * (chopclk<6:0> + 1) * primary master pwm input clock period ) bit 2-0 unimplemented: read as 0 note 1: the chop clock generator operates with the primary pwm clock prescaler (pclkdiv<2:0>) in the ptcon2 register ( register 15-2 ). downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 161 dspic33epxxgs202 family register 15-10: mdc: pwm ma ster duty cycle register ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 mdc<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 mdc<15:0>: master pwm duty cycle value bits note 1: the smallest pulse width that can be generated on the pwmx output corresponds to a value of 0x0008, while the maximum pulse width generated corresponds to a value of period C 0x0008. 2: as the duty cycle gets closer to 0% or 100% of the pwm period (0 to 40 ns, depending on the mode of operation), pwm duty cycle resolution will increase from 1 to 3 lsbs. register 15-11: pwmkey: pwm protection lock/unlock key register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pwmkey<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pwmkey<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 pwmkey<15:0>: pwm protection lock/unlock key value bits downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 162 ? 2015-2016 microchip technology inc. register 15-12: pwmconx: pwmx control register hs/hc-0 hs/hc-0 hs/hc-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 fltstat ( 1 ) clstat ( 1 ) trgstat fltien clien trgien itb ( 3 ) mdcs ( 3 ) bit 15 bit 8 r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 dtc1 dtc0 m t b sc a m ( 2 , 3 , 4 ) xpres ( 5 ) iue bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 fltstat: fault interrupt status bit ( 1 ) 1 = fault interrupt is pending 0 = no fault interrupt is pending this bit is cleared by setting fltien = 0 . bit 14 clstat: current-limit interrupt status bit ( 1 ) 1 = current-limit interrupt is pending 0 = no current-limit interrupt is pending this bit is cleared by setting clien = 0 . bit 13 trgstat: trigger interrupt status bit 1 = trigger interrupt is pending 0 = no trigger interrupt is pending this bit is cleared by setting trgien = 0 . bit 12 fltien: fault interrupt enable bit 1 = fault interrupt is enabled 0 = fault interrupt is disabled and the fltstat bit is cleared bit 11 clien: current-limit interrupt enable bit 1 = current-limit interrupt is enabled 0 = current-limit interrupt is disabled and the clstat bit is cleared bit 10 trgien: trigger interrupt enable bit 1 = a trigger event generates an interrupt request 0 = trigger event interrupts are disabled and the trgstat bit is cleared bit 9 itb: independent time base mode bit ( 3 ) 1 = phasex/sphasex registers provide the time base period for this pwmx generator 0 = ptper register provides timing for this pwmx generator bit 8 mdcs: master duty cycle register select bit ( 3 ) 1 = mdc register provides duty cycle information for this pwmx generator 0 = pdcx and sdcx registers provide duty cycle information for this pwmx generator note 1: software must clear the interrupt status here and in the corresponding ifsx register in the interrupt controller. 2: the independent time base mode (itb = 1 ) must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 3: these bits should not be changed after the pwm is enabled by setting pten (ptcon<15>) = 1 . 4: center-aligned mode ignores the least significant 3 bits of the duty cycle, phase and dead-time registers. the highest center-aligned mode resolution available is 8.32 ns with the clock prescaler set to the fastest clock. 5: configure clmod (fclconx<8>) = 0 and itb (pwmconx<9>) = 1 to operate in external period reset mode. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 163 dspic33epxxgs202 family bit 7-6 dtc<1:0>: dead-time control bits 11 = reserved 10 = dead-time function is disabled 01 = negative dead time is actively applied for complementary output mode 00 = positive dead time is actively applied for all output modes bit 5-4 unimplemented: read as 0 bit 3 mtbs: master time base select bit 1 = pwmx generator uses the secondary master time base for synchronization and the clock source for the pwmx generation logic (if secondary time base is available) 0 = pwmx generator uses the primary master time base for synchronization and the clock source for the pwmx generation logic bit 2 cam: center-aligned mode enable bit ( 2 , 3 , 4 ) 1 = center-aligned mode is enabled 0 = edge-aligned mode is enabled bit 1 xpres: external pwmx reset control bit ( 5 ) 1 = current-limit source resets the time base for this pwmx generator if it is in independent time base mode 0 = external pins do not affect the pwmx time base bit 0 iue: immediate update enable bit 1 = updates to the active duty cycle, phase offset, dead-time and local time base period registers are immediate 0 = updates to the active duty cycle, phase offset, dead-time and local time base period registers are synchronized to the local pwmx time base register 15-12: pwmconx: pwmx control register (continued) note 1: software must clear the interrupt status here and in the corresponding ifsx register in t he interrupt controller. 2: the independent time base mode (itb = 1 ) must be enabled to use center-aligned mode. if itb = 0 , the cam bit is ignored. 3: these bits should not be changed after the pwm is enabled by setting pten (ptcon<15>) = 1 . 4: center-aligned mode ignores the least significant 3 bits of the duty cycle, phase and dead-time registers. the highest center-aligned mode resolution available is 8.32 ns with the clock prescaler set to the fastest clock. 5: configure clmod (fclconx<8>) = 0 and itb (pwmconx<9>) = 1 to operate in external period reset mode. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 164 ? 2015-2016 microchip technology inc. register 15-13: pdcx: pwmx generator duty cycle register ( 1 , 2 , 3 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pdcx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 pdcx<15:0>: pwmx generator duty cycle value bits note 1: in independent pwm mode, the pdcx register controls the pwmxh duty cycle only. in the complementary, redundant and push-pull pwm modes, the pdcx register controls the duty cycle of both the pwmxh and pwmxl. 2: the smallest pulse width that can be generated on the pwmx output corresponds to a value of 0x0008, while the maximum pulse width generated corresponds to a value of period C 0x0008. 3: as the duty cycle gets closer to 0% or 100% of the pwm period (0 to 40 ns, depending on the mode of operation), pwm duty cycle resolution will increase from 1 to 3 lsbs. register 15-14: sdcx: pwmx secondary duty cycle register ( 1 , 2 , 3 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sdcx<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sdcx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 sdcx<15:0>: secondary duty cycle for pwmxl output pin bits note 1: the sdcx register is used in independent pwm mode only. when used in independent pwm mode, the sdcx register controls the pwmxl duty cycle. 2: the smallest pulse width that can be generated on the pwm output corresponds to a value of 0x0008, while the maximum pulse width generated corresponds to a value of period C 0x0008. 3: as the duty cycle gets closer to 0% or 100% of the pwm period (0 to 40 ns, depending on the mode of operation), pwm duty cycle resolution will increase from 1 to 3 lsbs. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 165 dspic33epxxgs202 family register 15-15: phasex: pwmx primary phase-shift register ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 phasex<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 phasex<15:0>: pwmx phase-shift value or independent time base period for the pwmx generator bits note 1: if pwmconx<9> = 0 , the following applies based on the mode of operation: complementary, redundant and push-pull output mode (ioconx<11:10> = 00 , 01 or 10 ); phasex<15:0> = phase-shift value for pwmxh and pwmxl outputs true independent output mode (ioconx<11:10> = 11 ); phasex<15:0> = phase-shift value for pwmxh only when the phasex/sphasex registers provide the phase shift with respect to the master time base; therefore, the valid range is 0x0000 through period 2: if pwmconx<9> = 1 , the following applies based on the mode of operation: complementary, redundant, and push-pull output mode (ioconx<11:10> = 00 , 01 or 10 ); phasex<15:0> = independent time base period value for pwmxh and pwmxl true independent output mode (ioconx<11:10> = 11 ); phasex<15:0> = independent time base period value for pwmxh only when the phasex/sphasex registers provide the local period, the valid range is 0x0000 through 0xfff8 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 166 ? 2015-2016 microchip technology inc. register 15-16: sphase x: pwmx secondary phase-shift register ( 1 , 2 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sphasex<15:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sphasex<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-0 sphasex<15:0>: secondary phase offset for pwmxl output pin bits (used in independent pwm mode only) note 1: if pwmconx<9> = 0 , the following applies based on the mode of operation: complementary, redundant and push-pull output mode (ioconx<11:10> = 00 , 01 or 10 ); sphasex<15:0> = not used true independent output mode (ioconx<11:10> = 11 ), sphasex<15:0> = phase-shift value for pwmxl only 2: if pwmconx<9> = 1 , the following applies based on the mode of operation: complementary, redundant and push-pull output mode (ioconx<11:10> = 00 , 01 or 10 ); sphasex<15:0> = not used true independent output mode (ioconx<11:10> = 11 ); sphasex<15:0> = independent time base period value for pwmxl only when the phasex/sphasex registers provide the local period, the valid range of values is 0x0010-0xfff8 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 167 dspic33epxxgs202 family register 15-17: dtrx: pwmx dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-0 dtrx<13:0>: unsigned 14-bit dead-time value for pwmx dead-time unit bits register 15-18: altdtrx: pwmx alternate dead-time register u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 altdtrx<13:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 altdtrx<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 unimplemented: read as 0 bit 13-0 altdtrx<13:0>: unsigned 14-bit alternate dead-time value for pwmx dead-time unit bits downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 168 ? 2015-2016 microchip technology inc. register 15-19: trgconx: pwmx trigger control register r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 trgdiv3 trgdiv2 trgdiv1 trgdiv0 bit 15 bit 8 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dtm ( 1 ) trgstrt5 trgstrt4 trgstrt3 trgstrt2 trgstrt1 trgstrt0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-12 trgdiv<3:0>: trigger # output divider bits 1111 = trigger output for every 16th trigger event 1110 = trigger output for every 15th trigger event 1101 = trigger output for every 14th trigger event 1100 = trigger output for every 13th trigger event 1011 = trigger output for every 12th trigger event 1010 = trigger output for every 11th trigger event 1001 = trigger output for every 10th trigger event 1000 = trigger output for every 9th trigger event 0111 = trigger output for every 8th trigger event 0110 = trigger output for every 7th trigger event 0101 = trigger output for every 6th trigger event 0100 = trigger output for every 5th trigger event 0011 = trigger output for every 4th trigger event 0010 = trigger output for every 3rd trigger event 0001 = trigger output for every 2nd trigger event 0000 = trigger output for every trigger event bit 11-8 unimplemented: read as 0 bit 7 dtm: dual trigger mode bit ( 1 ) 1 = secondary trigger event is combined with the primary trigger event to create a pwm trigger 0 = secondary trigger event is not combined with the primary trigger event to create a pwm trigger; two separate pwm triggers are generated bit 6 unimplemented: read as 0 bit 5-0 trgstrt<5:0>: trigger postscaler start enable select bits 111111 = wait 63 pwm cycles before generating the first trigger event after the module is enabled 000010 = wait 2 pwm cycles before generating the first trigger event after the module is enabled 000001 = wait 1 pwm cycle before generating the first trigger event after the module is enabled 000000 = wait 0 pwm cycles before generating the first trigger event after the module is enabled note 1: the secondary pwmx generator cannot generate pwm trigger interrupts. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 169 dspic33epxxgs202 family register 15-20: ioconx: pw mx i/o control register r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 penh penl polh poll pmod1 ( 1 ) pmod0 ( 1 ) ovrenh ovrenl bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ovrdat1 ovrdat0 fltdat1 ( 2 ) fltdat0 ( 2 ) cldat1 ( 2 ) cldat0 ( 2 ) swap osync bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 penh: pwmxh output pin ownership bit 1 = pwm module controls the pwmxh pin 0 = gpio module controls the pwmxh pin bit 14 penl: pwmxl output pin ownership bit 1 = pwm module controls the pwmxl pin 0 = gpio module controls the pwmxl pin bit 13 polh: pwmxh output pin polarity bit 1 = pwmxh pin is active-low 0 = pwmxh pin is active-high bit 12 poll: pwmxl output pin polarity bit 1 = pwmxl pin is active-low 0 = pwmxl pin is active-high bit 11-10 pmod<1:0>: pwmx i/o pin mode bits ( 1 ) 11 = pwmx i/o pin pair is in the true independent output mode 10 = pwmx i/o pin pair is in the push-pull output mode 01 = pwmx i/o pin pair is in the redundant output mode 00 = pwmx i/o pin pair is in the complementary output mode bit 9 ovrenh: override enable for pwmxh pin bit 1 = ovrdat1 provides data for output on the pwmxh pin 0 = pwmx generator provides data for the pwmxh pin bit 8 ovrenl: override enable for pwmxl pin bit 1 = ovrdat0 provides data for output on the pwmxl pin 0 = pwmx generator provides data for the pwmxl pin bit 7-6 ovrdat<1:0>: data for pwmxh, pwmxl pins if override is enabled bits if overenh = 1 , ovrdat1 provides the data for the pwmxh pin. if overenl = 1 , ovrdat0 provides the data for the pwmxl pin. bit 5-4 fltdat<1:0>: state for pwmxh and pwmxl pins if fltmod<1:0> are enabled bits ( 2 ) ifltmod (fclconx<15>) = 0 : normal fault mode: if fault is active, then fltdat1 provides the state for the pwmxh pin. if fault is active, then fltdat0 provides the state for the pwmxl pin. ifltmod (fclconx<15>) = 1 : independent fault mode: if current-limit is active, then fltdat1 provides the state for the pwmxh pin. if fault is active, then fltdat0 provides the state for the pwmxl pin. note 1: these bits should not be changed after the pwm module is enabled (pten = 1 ). 2: state represents the active/inactive state of the pwmx depending on the polh and poll bits settings. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 170 ? 2015-2016 microchip technology inc. bit 3-2 cldat<1:0>: state for pwmxh and pwmxl pins if clmod is enabled bits ( 2 ) ifltmod (fclconx<15>) = 0 : normal fault mode: if current-limit is active, then cldat1 provides the state for the pwmxh pin. if current-limit is active, then cldat0 provides the state for the pwmxl pin. ifltmod (fclconx<15>) = 1 : independent fault mode: cldat<1:0> bits are ignored. bit 1 swap: swap pwmxh and pwmxl pins bit 1 = pwmxh output signal is connected to the pwmxl pins; pwmxl output signal is connected to the pwmxh pins 0 = pwmxh and pwmxl pins are mapped to their respective pins bit 0 osync: output override synchronization bit 1 = output overrides via the ovrdat<1:0> bits are synchronized to the pwmx time base 0 = output overrides via the ovddat<1:0> bits occur on the next cpu clock boundary register 15-20: ioconx: pwmx i/o control register (continued) note 1: these bits should not be changed after the pwm module is enabled (pten = 1 ). 2: state represents the active/inactive state of the pwmx depending on the polh and poll bits settings. register 15-21: trigx: pwmx primary trigger compare value register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgcmp<12:5> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 trgcmp<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 trgcmp<12:0>: trigger compare value bits when the primary pwm functions in the local time base, this register contains the compare values that can trigger the adc module. bit 2-0 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 171 dspic33epxxgs202 family register 15-22: fclconx: pwmx fau lt current-limit control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ifltmod clsrc4 clsrc3 clsrc2 clsrc1 clsrc0 clpol ( 1 ) clmod bit 15 bit 8 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 r/w-0 fltsrc4 fltsrc3 fltsrc2 fltsrc1 fltsrc0 fltpol ( 1 ) fltmod1 fltmod0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 ifltmod: independent fault mode enable bit 1 = independent fault mode: current-limit input maps fltdat1 to the pwmxh output and t he fault input maps fltdat0 to the pwmxl output. the cldat<1:0> bits are not used for override functi ons. 0 = normal fault mode: current-limit mode maps the cldat<1:0> bits to the pwmxh and pwmxl outputs. the pwm fault mode maps fltdat<1:0> to the pwmxh and pwmxl outputs. bit 14-10 clsrc<4:0>: current-limit control signal source select for pwmx generator bits 11111 = reserved 10001 = reserved 10000 = reserved 01111 = reserved 01110 = analog comparator 2 01101 = analog comparator 1 01100 = reserved 01011 = reserved 01010 = reserved 01001 = reserved 01000 = fault 8 00111 = fault 7 00110 = fault 6 00101 = fault 5 00100 = fault 4 00011 = fault 3 00010 = fault 2 00001 = fault 1 00000 = reserved bit 9 clpol: current-limit polarity for pwmx generator # bit ( 1 ) 1 = the selected current-limit source is active-low 0 = the selected current-limit source is active-high bit 8 clmod: current-limit mode enable for pwmx generator # bit 1 = current-limit mode is enabled 0 = current-limit mode is disabled note 1: these bits should be changed only when pten (ptcon<15>) = 0 . downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 172 ? 2015-2016 microchip technology inc. bit 7-3 fltsrc<4:0>: fault control signal source select for pwmx generator # bits 11111 = reserved 10001 = reserved 10000 = reserved 01111 = reserved 01110 = analog comparator 2 01101 = analog comparator 1 01100 = reserved 01011 = reserved 01010 = reserved 01001 = reserved 01000 = fault 8 00111 = fault 7 00110 = fault 6 00101 = fault 5 00100 = fault 4 00011 = fault 3 00010 = fault 2 00001 = fault 1 00000 = reserved bit 2 fltpol: fault polarity for pwmx generator # bit ( 1 ) 1 = the selected fault source is active-low 0 = the selected fault source is active-high bit 1-0 fltmod<1:0>: fault mode for pwmx generator # bits 11 = fault input is disabled 10 = reserved 01 = the selected fault source forces the pwmxh, pwmxl pins to the fltdatx values (cycle) 00 = the selected fault source forces the pwmxh, pwmxl pins to the fltdatx values (latched condition) register 15-22: fclconx: pwmx fault curre nt-limit control register (continued) note 1: these bits should be changed only when pten (ptcon<15>) = 0 . register 15-23: strigx: pwmx seco ndary trigger compare value register ( 1 ) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 strgcmp<12:5> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 strgcmp<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 strgcmp<12:0>: secondary trigger compare value bits when the secondary pwmx functions in the local time base, this register contains the compare va lues that can trigger the adc module. bit 2-0 unimplemented: read as 0 note 1: strigx cannot generate the pwmx trigger interrupts. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 173 dspic33epxxgs202 family register 15-24: lebconx: pwmx leading-edge blanking (leb) control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 phr phf plr plf fltleben clleben bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 b c h ( 1 ) bcl ( 1 ) bphh bphl bplh bpll bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 phr: pwmxh rising edge trigger enable bit 1 = rising edge of pwmxh will trigger the leading-edge blanking counter 0 = leading-edge blanking ignores the rising edge of pwmxh bit 14 phf: pwmxh falling edge trigger enable bit 1 = falling edge of pwmxh will trigger the leading-edge blanking counter 0 = leading-edge blanking ignores the falling edge of pwmxh bit 13 plr: pwmxl rising edge trigger enable bit 1 = rising edge of pwmxl will trigger the leading-edge blanking counter 0 = leading-edge blanking ignores the rising edge of pwmxl bit 12 plf: pwmxl falling edge trigger enable bit 1 = falling edge of pwmxl will trigger the leading-edge blanking counter 0 = leading-edge blanking ignores the falling edge of pwmxl bit 11 fltleben: fault input leading-edge blanking enable bit 1 = leading-edge blanking is applied to the selected fault input 0 = leading-edge blanking is not applied to the selected fault input bit 10 clleben: current-limit leading-edge blanking enable bit 1 = leading-edge blanking is applied to the selected current-limit input 0 = leading-edge blanking is not applied to the selected current-limit input bit 9-6 unimplemented: read as 0 bit 5 bch: blanking in selected blanking signal high enable bit ( 1 ) 1 = state blanking (of current-limit and/or fault input signals) when the selected blanking signal is high 0 = no blanking when the selected blanking signal is high bit 4 bcl: blanking in selected blanking signal low enable bit ( 1 ) 1 = state blanking (of current-limit and/or fault input signals) when the selected blanking signal is low 0 = no blanking when the selected blanking signal is low bit 3 bphh: blanking in pwmxh high enable bit 1 = state blanking (of current-limit and/or fault input signals) when the pwmxh output is high 0 = no blanking when the pwmxh output is high bit 2 bphl: blanking in pwmxh low enable bit 1 = state blanking (of current-limit and/or fault input signals) when the pwmxh output is low 0 = no blanking when the pwmxh output is low note 1: the blanking signal is selected via the blanksel<3:0> bits in the auxconx register. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 174 ? 2015-2016 microchip technology inc. bit 1 bplh: blanking in pwmxl high enable bit 1 = state blanking (of current-limit and/or fault input signals) when the pwmxl output is high 0 = no blanking when the pwmxl output is high bit 0 bpll: blanking in pwmxl low enable bit 1 = state blanking (of current-limit and/or fault input signals) when the pwmxl output is low 0 = no blanking when the pwmxl output is low register 15-24: lebconx: pwmx leading-edge blanking (leb) control register (continued) note 1: the blanking signal is selected via the blanksel<3:0> bits in the auxconx register. register 15-25: lebdlyx: pwmx leadi ng-edge blanking delay register u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 leb<8:5> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 leb<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as 0 bit 11-3 leb<8:0>: leading-edge blanking delay for current-limit and fault inputs bits the value is in 8.32 ns increments. bit 2-0 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 175 dspic33epxxgs202 family register 15-26: auxconx: pwmx auxiliary control register r/w-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 hrpdis hrddis blanksel3 blanksel2 blanksel1 blanksel0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 chopsel3 chopsel2 chopsel1 chopsel0 chophen choplen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 hrpdis: high-resolution pwmx period disable bit 1 = high-resolution pwmx period is disabled to reduce power consumption 0 = high-resolution pwmx period is enabled bit 14 hrddis: high-resolution pwmx duty cycle disable bit 1 = high-resolution pwmx duty cycle is disabled to reduce power consumption 0 = high-resolution pwmx duty cycle is enabled bit 13-12 unimplemented: read as 0 bit 11-8 blanksel<3:0>: pwmx state blank source select bits the selected state blank signal will block the current-limit and/or fault input signals (if enabled via the bch and bcl bits in the lebconx register). 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = reserved 0100 = reserved 0011 = pwm3h is selected as the state blank source 0010 = pwm2h is selected as the state blank source 0001 = pwm1h is selected as the state blank source 0000 = no state blanking bit 7-6 unimplemented: read as 0 bit 5-2 chopsel<3:0>: pwmx chop clock source select bits the selected signal will enable and disable (chop) the selected pwmx outputs. 1001 = reserved 1000 = reserved 0111 = reserved 0110 = reserved 0101 = reserved 0100 = reserved 0011 = pwm3h is selected as the chop clock source 0010 = pwm2h is selected as the chop clock source 0001 = pwm1h is selected as the chop clock source 0000 = chop clock generator is selected as the chop clock source bit 1 chophen: pwmxh output chopping enable bit 1 = pwmxh chopping function is enabled 0 = pwmxh chopping function is disabled bit 0 choplen: pwmxl output chopping enable bit 1 = pwmxl chopping function is enabled 0 = pwmxl chopping function is disabled downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 176 ? 2015-2016 microchip technology inc. register 15-27: pwmcapx: pwmx primary time base capture register r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 pwmcap<12:5> ( 1 , 2 , 3 , 4 ) bit 15 bit 8 r-0 r-0 r-0 r-0 r-0 u-0 u-0 u-0 pwmcap<4:0> ( 1 , 2 , 3 , 4 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-3 pwmcap<12:0>: captured pwmx time base value bits ( 1 , 2 , 3 , 4 ) the value in this register represents the captured pwmx time base value when a leading edge is detected on the current-limit input. bit 2-0 unimplemented: read as 0 note 1: the capture feature is only available on a primary output (pwmxh). 2: this feature is active only after leb processing on the current-limit input signal is complete. 3: the minimum capture resolution is 8.32 ns. 4: this feature can be used when the xpres bit (pwmconx<1>) is set to 0 . downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 177 dspic33epxxgs202 family 16.0 serial peripheral interface (spi) the spi module is a synchronous serial interface, useful for communicating with other peripherals or microcontroller devices. these peripheral devices can be serial eeproms, shift registers, display drivers, adc converters, etc. the spi module is compatible with motorola ? spi and siop interfaces. the dspic33epxxgs202 device family offers one spi module on a single device. the spi1 module takes advantage of the peripheral pin select (pps) feature to allow for greater flexibility in pin configuration. the spi1 serial interface consists of four pins, as follows: sdi1: serial data input sdo1: serial data output sck1: shift clock input or output ss 1 /fsync1: active-low slave select or frame synchronization i/o pulse the spi1 module can be configured to operate with two, three or four pins. in 3-pin mode, ss 1 is not used. in 2-pin mode, neither sdo1 nor ss 1 is used. figure 16-1 illustrates the block diagram of the spi1 module in standard and enhanced modes. figure 16-1: spi1 module block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?serial peripheral interface (spi)? (ds70005185) in the ?dspic33/pic24 family reference man- ual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. internal data bus sdi1 sdo1 ss 1 /fsync1 sck1 bit 0 shift control edge select f p primary 1:1/4/16/64 enable prescaler sync control transfer transfer write spi1buf read spi1buf 16 spi1con1<1:0> spi1con1<4:2> master clock note 1: in standard mode, the fifo is only one-level deep. clock control secondary prescaler 1:1 to 1:8 spi1sr 8-level fifo receive buffer (1) 8-level fifo transmit buffer (1) spi1buf downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 178 ? 2015-2016 microchip technology inc. 16.1 spi helpful tips 1. in frame mode, if there is a possibility that the master may not be initialized before the slave: a) if frmpol (spi1con2<13>) = 1 , use a pull-down resistor on ss 1 . b) if frmpol = 0 , use a pull-up resistor on ss1 . 2. in non-framed 3-wire mode (i.e., not using ss 1 from a master): a) if ckp (spi1con1<6>) = 1 , always place a pull-up resistor on ss 1 . b) if ckp = 0 , always place a pull-down resistor on ss1 . 3. frmen (spi1con2<15>) = 1 and ssen (spi1con1<7>) = 1 are exclusive and invalid. in frame mode, sck1 is continuous and the frame sync pulse is active on the ss1 pin, which indicates the start of a data frame. 4. in master mode only, set the smp bit (spi1con1<9>) to a 1 for the fastest spi1 data rate possible. the smp bit can only be set at the same time or after the msten bit (spi1con1<5>) is set. to avoid invalid slave read data to the master, the users master software must ensure enough time for slave software to fill its write buffer before the user application initiates a master write/read cycle. it is always advisable to preload the spi1buf transmit register in advance of the next master transaction cycle. spi1buf is transferred to the spi1 shift register and is empty once the data transmission begins. 16.2 spi resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 16.2.1 key resources ?serial peripheral interface (spi)? (ds70005185) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools note: this ensures that the first frame transmission after initialization is not shifted or corrupted. note: this will ensure that during power-up and initialization, the master/slave will not lose synchronization due to an errant sck1 transition that would cause the slave to accumulate data shift errors for both transmit and receive, appearing as corrupted data. note: not all third-party devices support frame mode timing. refer to the spi1 specifications in section 25.0 ?electrical characteristics? for details. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 179 dspic33epxxgs202 family 16.3 spi control registers register 16-1: spi1stat: spi1 status and control register r/w-0 u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 spien spisidl spibec2 spibec1 spibec0 bit 15 bit 8 r/w-0 r/c-0, hs r/w-0 r/w-0 r/w-0 r/w-0 r-0, hs, hc r-0, hs, hc srmpt spirov srxmpt sisel2 s isel1 sisel0 spitbf spirbf bit 7 bit 0 legend: c = clearable bit hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 spien: spi1 enable bit 1 = enables the module and configures sck1, sdo1, sdi1 and ss 1 as serial port pins 0 = disables the module bit 14 unimplemented: read as 0 bit 13 spisidl: spi1 stop in idle mode bit 1 = discontinues the module operation when device enters idle mode 0 = continues the module operation in idle mode bit 12-11 unimplemented: read as 0 bit 10-8 spibec<2:0>: spi1 buffer element count bits (valid in enhanced buffer mode) master mode: number of spi1 transfers that are pending. slave mode: number of spi1 transfers that are unread. bit 7 srmpt: spi1 shift register (spi1sr) empty bit (valid in enhanced buffer mode) 1 = spi1 shift register is empty and ready to send or receive the data 0 = spi1 shift register is not empty bit 6 spirov: spi1 receive overflow flag bit 1 = a new byte/word is completely received and discarded; the user application has not read the previous data in the spi1buf register 0 = no overflow has occurred bit 5 srxmpt: spi1 receive fifo empty bit (valid in enhanced buffer mode) 1 = rx fifo is empty 0 = rx fifo is not empty bit 4-2 sisel<2:0>: spi1 buffer interrupt mode bits (valid in enhanced buffer mode) 111 = interrupt when the spi1 transmit buffer is full (spitbf bit is set) 110 = interrupt when last bit is shifted into spi1sr, and as a result, the tx fifo is empty 101 = interrupt when the last bit is shifted out of spi1sr and the transmit is complete 100 = interrupt when one data is shifted into the spi1sr, and as a result, the tx fifo has one open memory location 011 = interrupt when the spi1 receive buffer is full (spirbf bit is set) 010 = interrupt when the spi1 receive buffer is 3/4 or more full 001 = interrupt when data is available in the receive buffer (srmpt bit is set) 000 = interrupt when the last data in the receive buffer is read, and as a result, the buffer is empty (srxmpt bit is set) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 180 ? 2015-2016 microchip technology inc. bit 1 spitbf: spi1 transmit buffer full status bit 1 = transmit has not yet started, spi1txb is full 0 = transmit has started, spi1txb is empty standard buffer mode: automatically set in hardware when core writes to the spi1buf location, loading spi1txb. automatically cleared in hardware when spi1 module transfers data from spi1txb to spi1sr. enhanced buffer mode: automatically set in hardware when the cpu writes to the spi1buf location, loading the last available buffer location. automatically cleared in hardware when a buffer location is available for a cpu write operation. bit 0 spirbf: spi1 receive buffer full status bit 1 = receive is complete, spi1rxb is full 0 = receive is incomplete, spi1rxb is empty standard buffer mode: automatically set in hardware when spi1 transfers data from spi1sr to spi1rxb. automatically cleared in hardware when the core reads the spi1buf location, reading spi1rxb. enhanced buffer mode: automatically set in hardware when spi1 transfers data from spi1sr to the buffer, filling the last unread buffer location. automatically cleared in hardware when a buffer location is available for a transfer from spi1sr. register 16-1: spi1stat: spi1 status and control register (continued) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 181 dspic33epxxgs202 family register 16-2: spi1con1: spi1 control register 1 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 dissck dissdo mode16 smp cke ( 1 ) bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ssen ( 2 ) ckp msten spre2 ( 3 ) spre1 ( 3 ) spre0 ( 3 ) ppre1 ( 3 ) ppre0 ( 3 ) bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12 dissck: disable sck1 pin bit (spi1 master modes only) 1 = internal spi1 clock is disabled, pin functions as i/o 0 = internal spi1 clock is enabled bit 11 dissdo: disable sdo1 pin bit 1 = sdo1 pin is not used by the module; pin functions as i/o 0 = sdo1 pin is controlled by the module bit 10 mode16: word/byte communication select bit 1 = communication is word-wide (16 bits) 0 = communication is byte-wide (8 bits) bit 9 smp: spi1 data input sample phase bit master mode: 1 = input data is sampled at the end of data output time 0 = input data is sampled at the middle of data output time slave mode: smp must be cleared when spi1 is used in slave mode. bit 8 cke: spi1 clock edge select bit ( 1 ) 1 = serial output data changes on transition from active clock state to idle clock state (refer to bit 6) 0 = serial output data changes on transition from idle clock state to active clock state (refer to bit 6) bit 7 ssen: slave select enable bit (slave mode) ( 2 ) 1 = ss 1 pin is used for slave mode 0 = ss 1 pin is not used by the module; pin is controlled by port function bit 6 ckp: clock polarity select bit 1 = idle state for clock is a high level; active state is a low level 0 = idle state for clock is a low level; active state is a high level bit 5 msten: master mode enable bit 1 = master mode 0 = slave mode note 1: the cke bit is not used in framed spi modes. program this bit to 0 for framed spi modes (frmen = 1 ). 2: this bit must be cleared when frmen = 1 . 3: do not set both primary and secondary prescalers to the value of 1:1. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 182 ? 2015-2016 microchip technology inc. bit 4-2 spre<2:0>: secondary prescale bits (master mode) ( 3 ) 111 = secondary prescale 1:1 110 = secondary prescale 2:1 000 = secondary prescale 8:1 bit 1-0 ppre<1:0>: primary prescale bits (master mode) ( 3 ) 11 = primary prescale 1:1 10 = primary prescale 4:1 01 = primary prescale 16:1 00 = primary prescale 64:1 register 16-2: spi1con1: spi1 control register 1 (continued) note 1: the cke bit is not used in framed spi modes. program this bit to 0 for framed spi modes (frmen = 1 ). 2: this bit must be cleared when frmen = 1 . 3: do not set both primary and secondary prescalers to the value of 1:1. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 183 dspic33epxxgs202 family register 16-3: spi1con2: spi1 control register 2 r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 u-0 u-0 frmen spifsd frmpol bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 frmdly spiben bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 frmen: framed spi1 support bit 1 = framed spi1 support is enabled (ss 1 pin is used as frame sync pulse input/output) 0 = framed spi1 support is disabled bit 14 spifsd: frame sync pulse direction control bit 1 = frame sync pulse input (slave) 0 = frame sync pulse output (master) bit 13 frmpol: frame sync pulse polarity bit 1 = frame sync pulse is active-high 0 = frame sync pulse is active-low bit 12-2 unimplemented: read as 0 bit 1 frmdly: frame sync pulse edge select bit 1 = frame sync pulse coincides with first bit clock 0 = frame sync pulse precedes first bit clock bit 0 spiben: enhanced buffer enable bit 1 = enhanced buffer is enabled 0 = enhanced buffer is disabled (standard mode) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 184 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 185 dspic33epxxgs202 family 17.0 inter-integrated circuit (i 2 c) the dspic33epxxgs202 family of devices contains one inter-integrated circuit (i 2 c) module. the i 2 c module provides complete hardware support for both slave and multi-master modes of the i 2 c serial communication standard, with a 16-bit interface. the i 2 c module has a 2-pin interface: the scl1 pin is clock the sda1 pin is data the i 2 c module offers the following key features: i 2 c interface supporting both master and slave modes of operation i 2 c slave mode supports 7 and 10-bit addressing i 2 c master mode supports 7 and 10-bit addressing i 2 c port allows bidirectional transfers between master and slaves serial clock synchronization for i 2 c port can be used as a handshake mechanism to suspend and resume serial transfer (sclrel control) i 2 c supports multi-master operation, detects bus collision and arbitrates accordingly system management bus (smbus) support 17.1 i 2 c resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 17.1.1 key resources ?inter-integrated circuit? (i 2 c?)? (ds70000195) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?inter-integrated circuit? (i 2 c?)? (ds70000195) in the ?dspic33/pic24 family reference man- ual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 186 ? 2015-2016 microchip technology inc. figure 17-1: i2c1 block diagram internal data bus scl1 sda1 shift match detect start and stop bit detect clock address match clock stretching i2c1trn lsb shift clock reload control f p /2 start and stop bit generation acknowledge generation collision detect i2c1conl i2c1stat control logic read lsb write read i2c1brg i2c1rsr write read write read write read write read write read i2c1msk i2c1rcv i2c1add i2c1conh write read brg down counter downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 187 dspic33epxxgs202 family 17.2 i 2 c control registers register 17-1: i2c1conl: i2 c1 control register low r/w-0 u-0 r/w-0 r/w-1, hc r/w-0 r/w-0 r/w-0 r/w-0 i2cen i2csidl sclrel strict a10m disslw smen bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0, hc r/w-0, hc r/w-0, hc r/w-0, hc r/w-0, hc gcen stren ackdt acken rcen pen rsen sen bit 7 bit 0 legend: hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 i2cen: i2c1 enable bit 1 = enables the i2c1 module and configures the sda1 and scl1 pins as serial port pins 0 = disables the i2c1 module; all i 2 c pins are controlled by port functions bit 14 unimplemented: read as 0 bit 13 i2csidl: i2c1 stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 sclrel: scl1 release control bit (when operating as i 2 c slave) 1 = releases scl1 clock 0 = holds scl1 clock low (clock stretch) if stren = 1 : bit is r/w (i.e., software can write 0 to initiate stretch and write 1 to release clock). hardware is clear at the beginning of every slave data byte transmission. hardware is clear at the end of every slave address byte reception. hardware is clear at the end of every slave data byte reception. if stren = 0 : bit is r/s (i.e., software can only write 1 to release clock). hardware is clear at the beginning of every slave data byte transmission. hardware is clear at the end of every slave address byte reception. bit 11 strict: strict i2c1 reserved address enable bit 1 = strict reserved addressing is enabled: in slave mode, the device will nack any reserved address. in master mo de, the device is allowed to generate addresses within the reserved address space. 0 = reserved addressing is acknowledged: in slave mode, the device will ack any reserved address. in master mode, the device should not address a slave device with a reserved address. bit 10 a10m: 10-bit slave address bit 1 = i2c1add is a 10-bit slave address 0 = i2c1add is a 7-bit slave address bit 9 disslw: disable slew rate control bit 1 = slew rate control is disabled 0 = slew rate control is enabled bit 8 smen: smbus input levels bit 1 = enables i/o pin thresholds compliant with smbus specification 0 = disables smbus input thresholds bit 7 gcen: general call enable bit (when operating as i 2 c slave) 1 = enables interrupt when a general call address is received in i2c1rsr (module is enabl ed for reception) 0 = general call address is disabled downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 188 ? 2015-2016 microchip technology inc. bit 6 stren: scl1 clock stretch enable bit (when operating as i 2 c slave) used in conjunction with the sclrel bit. 1 = enables software or receives clock stretching 0 = disables software or receives clock stretching bit 5 ackdt: acknowledge data bit (when operating as i 2 c master, applicable during master receive) value that is transmitted when the software initiates an acknowledge sequence. 1 = sends nack during acknowledge 0 = sends ack during acknowledge bit 4 acken: acknowledge sequence enable bit (when operating as i 2 c master, applicable during master receive) 1 = initiates acknowledge sequence on the sda1 and scl1 pins and transmits the ackdt data bit. hardware clears it at the end of the master acknowledge sequence. 0 = acknowledge sequence is not in progress bit 3 rcen: receive enable bit (when operating as i 2 c master) 1 = enables receive mode for i 2 c. hardware clears it at the end of the eighth bit of the master receive data byte. 0 = receive sequence is not in progress bit 2 pen: stop condition enable bit (when operating as i 2 c master) 1 = initiates stop condition on the sda1 and scl1 pins. hardware clears it at the end of the master stop sequence. 0 = stop condition is not in progress bit 1 rsen: repeated start condition enable bit (when operating as i 2 c master) 1 = initiates repeated start condition on the sda1 and scl1 pins. hardware clears it at the end of the master repeated start sequence. 0 = repeated start condition is not in progress bit 0 sen: start condition enable bit (when operating as i 2 c master) 1 = initiates start condition on the sda1 and scl1 pins. hardware clears it at the end of t he master start sequence. 0 = start condition is not in progress register 17-1: i2c1conl: i2c1 co ntrol register low (continued) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 189 dspic33epxxgs202 family register 17-2: i2c1conh: i2 c1 control register high u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pcie scie boen sdaht sbcde ahen dhen bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-7 unimplemented: read as 0 bit 6 pcie: stop condition interrupt enable bit (i 2 c slave mode only) 1 = enables interrupt on detection of stop condition 0 = stop detection interrupts are disabled bit 5 scie: start condition interrupt enable bit (i 2 c slave mode only) 1 = enables interrupt on detection of start or restart conditions 0 = start detection interrupts are disabled bit 4 boen: buffer overwrite enable bit (i 2 c slave mode only) 1 = i2c1rcv is updated and an ack is generated for a received address/data byte, ignoring the state of the i2cov bit only if the rbf bit = 0 0 = i2c1rcv is only updated when i2cov is clear bit 3 sdaht: sda1 hold time selection bit 1 = minimum of 300 ns hold time on sda1 after the falling edge of scl1 0 = minimum of 100 ns hold time on sda1 after the falling edge of scl1 bit 2 sbcde: slave mode bus collision detect enable bit (i 2 c slave mode only) 1 = enables slave bus collision interrupts 0 = slave bus collision interrupts are disabled if the rising edge of scl1 and sda1 is sampled low when the module is in a high state, the bcl bit is set and the bus goes idle. this detection mode is only valid during data and ack transmit sequences. bit 1 ahen: address hold enable bit (i 2 c slave mode only) 1 = following the 8th falling edge of scl1 for a matching received address byte, the sclrel (i2c1conl<12>) bit will be cleared and scl1 will be held low 0 = address holding is disabled bit 0 dhen: data hold enable bit (i 2 c slave mode only) 1 = following the 8th falling edge of scl1 for a received data byte, the slave hardware clears the sclrel (i2c1conl<12>) bit and scl1 is held low 0 = data holding is disabled downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 190 ? 2015-2016 microchip technology inc. register 17-3: i2c1stat: i2c1 status register r-0, hsc r-0, hsc r-0, hsc u-0 u-0 r/c-0, hs r-0, hsc r-0, hsc ackstat trstat acktim bcl gcstat add10 bit 15 bit 8 r/c-0, hs r/c-0, hs r-0, hsc r/c-0, hsc r/c-0, hsc r-0, hsc r-0, hsc r-0, hsc iwcol i2cov d_a p s r_w rbf tbf bit 7 bit 0 legend: c = clearable bit hs = hardware settable bit hsc = hardware settable/clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 ackstat: acknowledge status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = nack was received from slave 0 = ack was received from slave it is set or cleared by the hardware at the end of a slave acknowledge. bit 14 trstat: transmit status bit (when operating as i 2 c master, applicable to master transmit operation) 1 = master transmit is in progress (8 bits + ack) 0 = master transmit is not in progress it is set by the hardware at the beginning of master transmission. hardware is clear at the end of slave acknowledge. bit 13 acktim: acknowledge time status bit (i 2 c slave mode only) 1 = i 2 c bus is an acknowledge sequence, set on the 8th falling edge of scl1 0 = not an acknowledge sequence, cleared on the 9th rising edge of scl1 bit 12-11 unimplemented: read as 0 bit 10 bcl: master bus collision detect bit 1 = a bus collision has been detected during a master operation 0 = no bus collision detected it is set by the hardware at detection of a bus collision. bit 9 gcstat: general call status bit 1 = general call address was received 0 = general call address was not received it is set by the hardware when the address matches the general call address. har dware is clear at stop detection. bit 8 add10: 10-bit address status bit 1 = 10-bit address was matched 0 = 10-bit address was not matched hardware is set at the match of the 2nd byte of the matched 10-bit address. hardware is clear at stop detection. bit 7 iwcol: i2c1 write collision detect bit 1 = an attempt to write to the i2c1trn register failed because the i 2 c module is busy 0 = no collision hardware is set at the occurrence of a write to i2c1trn while busy (cleared by software). bit 6 i2cov: i2c1 receive overflow flag bit 1 = a byte was received while the i2c1rcv register was still holding the previous byte 0 = no overflow it is set by the hardware at an attempt to transfer i2c1rsr to i2c1rcv (cle ared by software). bit 5 d_a: data/address bit (i 2 c slave mode only) 1 = indicates that the last byte received was data 0 = indicates that the last byte received was a device address it is cleared by the hardware at a device address match. hardware is set by reception o f a slave byte. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 191 dspic33epxxgs202 family bit 4 p: stop bit 1 = indicates that a stop bit has been detected last 0 = stop bit was not detected last hardware is set or clear when a start, repeated start or stop is detected. bit 3 s: start bit 1 = indicates that a start (or repeated start) bit has been detected last 0 = start bit was not detected last hardware is set or clear when a start, repeated start or stop is detected. bit 2 r_w: read/write information bit (i 2 c slave mode only) 1 = read C indicates data transfer is output from the slave 0 = write C indicates data transfer is input to the slave hardware is set or clear after reception of an i 2 c device address byte. bit 1 rbf: receive buffer full status bit 1 = receive is complete, i2c1rcv is full 0 = receive is not complete, i2c1rcv is empty hardware is set when i2c1rcv is written with a received byte. hardware is clea r when software reads i2c1rcv. bit 0 tbf: transmit buffer full status bit 1 = transmit is in progress, i2c1trn is full 0 = transmit is complete, i2c1trn is empty hardware is set when software writes to i2c1trn. hardware is clear at completion of a data transmission. register 17-3: i2c1stat: i2c1 status register (continued) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 192 ? 2015-2016 microchip technology inc. register 17-4: i2c1msk: i2c1 sl ave mode address mask register u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 amsk<9:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 amsk<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as 0 bit 9-0 amsk<9:0>: address mask select bits for 10-bit address: 1 = enables masking for bit ax of incoming message address; bit match is not required in this position 0 = disables masking for bit ax; bit match is required in this position for 7-bit address (i2c 1m sk<6:0> only): 1 = enables masking for bit ax + 1 of incoming message address; bit match is not required i n this position 0 = disables masking for bit ax + 1; bit match is required in this position downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 193 dspic33epxxgs202 family 18.0 universal asynchronous receiver transmitter (uart) the dspic33epxxgs202 family of devices contains one uart module. the universal asynchronous receiver transmitter (uart) module is one of the serial i/o modules available in the dspic33epxxgs202 device family. the uart is a full-duplex, asynchronous system that can communicate with peripheral devices, such as personal computers, lin/j2602, rs-232 and rs-485 interfaces. the module also supports a hardware flow control option with the u 1c ts and u 1r ts pins, and also includes an irda ? encoder and decoder. the primary features of the uart1 module are: full-duplex, 8 or 9-bit data transmission through the u1tx and u1rx pins even, odd or no parity options (for 8-bit data) one or two stop bits hardware flow control option with u 1c ts and u 1r ts pins fully integrated baud rate generator with 16-bit prescaler baud rates ranging from 4.375 mbps to 67 bps in 16x mode at 60 mips baud rates ranging from 17.5 mbps to 267 bps in 4x mode at 60 mips 4-deep first-in first-out (fifo) transmit data buffer 4-deep fifo receive data buffer parity, framing and buffer overrun error detection support for 9-bit mode with address detect (9th bit = 1 ) transmit and receive interrupts a separate interrupt for all uart1 error conditions loopback mode for diagnostic support support for sync and break characters support for automatic baud rate detection irda ? encoder and decoder logic 16x baud clock output for irda support a simplified block diagram of the uart1 module is shown in figure 18-1 . the uart1 module consists of these key hardware elements: baud rate generator asynchronous transmitter asynchronous receiver figure 18-1: uart1 simp lified block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?universal asynchro- nous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. u 1rx uart 1 receiver uart 1 transmitter u 1tx baud rate generator u 1r ts /bclk1 u 1c ts irda ? hardware flow control downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 194 ? 2015-2016 microchip technology inc. 18.1 uart helpful tips 1. in multi-node, direct connect uart networks, uart receive inputs react to the complemen- tary logic level defined by the urxinv bit (u1mode<4>), which defines the idle state, the default of which is logic high (i.e., urxinv = 0 ). because remote devices do not initialize at the same time, it is likely that one of the devices, because the rx line is floating, will trigger a start bit detection and will cause the first byte received, after the device has been initialized, to be invalid. to avoid this situation, the user should use a pull- up or pull-down resistor on the rx pin depending on the value of the urxinv bit. a) if ur1inv = 0 , use a pull-up resistor on the uxrx pin. b) if ur1inv = 1 , use a pull-down resistor on the uxrx pin. 2. the first character received on a wake-up from sleep mode, caused by activity on the u1rx pin of the uart1 module, will be invalid. in sleep mode, peripheral clocks are disabled. by the time the oscillator system has restarted and stabilized from sleep mode, the baud rate bit sampling clock, relative to the incoming u1rx bit timing, is no longer synchronized, resulting in the first character being invalid; this is to be expected. 18.2 uart resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 18.2.1 key resources ?universal asynchronous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 195 dspic33epxxgs202 family 18.3 uart control registers register 18-1: u1mode: uart1 mode register r/w-0 u-0 r/w-0 r/w-0 r/w-0 u-0 r/w-0 r/w-0 uarten ( 1 ) usidl iren ( 2 ) rtsmd u e n 1u e n 0 bit 15 bit 8 r/w-0, hc r/w-0 r/w-0, hc r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 wake lpback abaud urxinv brgh pdsel1 pdsel0 stsel bit 7 bit 0 legend: hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 uarten: uart1 enable bit ( 1 ) 1 = uart1 is enabled; all uart1 pins are controlled by uart1, as defined by uen<1:0> 0 = uart1 is disabled; all uart1 pins are controlled by port latches; uart1 power consum ption is minimal bit 14 unimplemented: read as 0 bit 13 usidl: uart1 stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12 iren: irda ? encoder and decoder enable bit ( 2 ) 1 = irda encoder and decoder are enabled 0 = irda encoder and decoder are disabled bit 11 rtsmd: mode selection for u 1r ts pin bit 1 =u 1r ts pin is in simplex mode 0 =u 1r ts pin is in flow control mode bit 10 unimplemented: read as 0 bit 9-8 uen<1:0>: uart1 pin enable bits 11 = u1tx, u1rx and bclk1 pins are enabled and used; u 1c ts pin is controlled by port latches 10 = u1tx, u1rx, u 1c ts and u 1r ts pins are enabled and used 01 = u1tx, u1rx and u 1r ts pins are enabled and used; u 1c ts pin is controlled by port latches 00 = u1tx and u1rx pins are enabled and used; u 1c ts and u 1r ts /bclk1 pins are controlled by port latches bit 7 wake: wake-up on start bit detect during sleep mode enable bit 1 = uart1 continues to sample the u1rx pin, interrupt is generated on the falling edge; bit is cle ared in hardware on the following rising edge 0 = no wake-up is enabled bit 6 lpback: uart1 loopback mode select bit 1 = enables loopback mode 0 = loopback mode is disabled bit 5 abaud: auto-baud enable bit 1 = enables baud rate measurement on the next character C requires reception of a sync field (55h) before other data; cleared in hardware upon completion 0 = baud rate measurement is disabled or completed note 1: refer to ?universal asynchronous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? for information on enabling the uart1 module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 196 ? 2015-2016 microchip technology inc. bit 4 urxinv: uart1 receive polarity inversion bit 1 = u1rx idle state is 0 0 = u1rx idle state is 1 bit 3 brgh: high baud rate enable bit 1 = brg generates 4 clocks per bit period (4x baud clock, high-speed mode) 0 = brg generates 16 clocks per bit period (16x baud clock, standard mode) bit 2-1 pdsel<1:0>: parity and data selection bits 11 = 9-bit data, no parity 10 = 8-bit data, odd parity 01 = 8-bit data, even parity 00 = 8-bit data, no parity bit 0 stsel: stop bit selection bit 1 = two stop bits 0 = one stop bit register 18-1: u1mode: uart1 mode register (continued) note 1: refer to ?universal asynchronous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? for information on enabling the uart1 module for receive or transmit operation. 2: this feature is only available for the 16x brg mode (brgh = 0 ). downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 197 dspic33epxxgs202 family register 18-2: u1sta: uart1 status and control register r/w-0 r/w-0 r/w-0 u-0 r/w-0, hc r/w-0 r-0 r-1 utxisel1 utxinv utxisel0 utxbrk utxen ( 1 ) utxbf trmt bit 15 bit 8 r/w-0 r/w-0 r/w-0 r-1 r-0 r-0 r/c-0 r-0 urxisel1 urxisel0 adden ridle perr ferr oerr urxda bit 7 bit 0 legend: c = clearable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15,13 utxisel<1:0>: uart1 transmission interrupt mode selection bits 11 = reserved; do not use 10 = interrupt when a character is transferred to the transmit shift register (tsr) and as a result, the transmit buffer becomes empty 01 = interrupt when the last character is shifted out of the transmit shift register; all transmit operations are completed 00 = interrupt when a character is transferred to the transmit shift register (this implies there is at least one character open in the transmit buffer) bit 14 utxinv: uart1 transmit polarity inversion bit if iren = 0 : 1 = u1tx idle state is 0 0 = u1tx idle state is 1 if iren = 1 : 1 =irda ? encoded, u1tx idle state is 1 0 = irda encoded, u1tx idle state is 0 bit 12 unimplemented: read as 0 bit 11 utxbrk: uart1 transmit break bit 1 = sends sync break on next transmission C start bit, followed by twelve 0 bits, followed by stop bit; cleared by hardware upon completion 0 = sync break transmission is disabled or completed bit 10 utxen: uart1 transmit enable bit ( 1 ) 1 = transmit is enabled, u1tx pin is controlled by uart1 0 = transmit is disabled, any pending transmission is aborted and buffer is reset; u1tx pin is controlled by the port bit 9 utxbf: uart1 transmit buffer full status bit (read-only) 1 = transmit buffer is full 0 = transmit buffer is not full, at least one more character can be written bit 8 trmt: transmit shift register empty bit (read-only) 1 = transmit shift register is empty and transmit buffer is empty (the last transmission has completed) 0 = transmit shift register is not empty, a transmission is in progress or queued bit 7-6 urxisel<1:0>: uart1 receive interrupt mode selection bits 11 = interrupt is set on u1rsr transfer, making the receive buffer full (i.e., has 4 data characters) 10 = interrupt is set on u1rsr transfer, making the receive buffer 3/4 full (i.e., has 3 data characters) 0x = interrupt is set when any character is received and transferred from the u1rsr to the receive buffer; receive buffer has one or more characters note 1: refer to ?universal asynchronous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? for information on enabling the uart1 module for transmit operation. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 198 ? 2015-2016 microchip technology inc. bit 5 adden: address character detect bit (bit 8 of received data = 1 ) 1 = address detect mode is enabled; if 9-bit mode is not selected, this does not take effect 0 = address detect mode is disabled bit 4 ridle: receiver idle bit (read-only) 1 = receiver is idle 0 = receiver is active bit 3 perr: parity error status bit (read-only) 1 = parity error has been detected for the current character (character at the top of the receive fifo) 0 = parity error has not been detected bit 2 ferr: framing error status bit (read-only) 1 = framing error has been detected for the current character (character at the top of the receive fifo) 0 = framing error has not been detected bit 1 oerr: receive buffer overrun error status bit (clear/read-only) 1 = receive buffer has overflowed 0 = receive buffer has not overflowed; clearing a previously set oerr bit ( 1 ? 0 transition) resets the receiver buffer and the u1rsr to the empty state bit 0 urxda: uart1 receive buffer data available bit (read-only) 1 = receive buffer has data, at least one more character can be read 0 = receive buffer is empty register 18-2: u1sta: uart1 status and control register (continued) note 1: refer to ?universal asynchronous receiver transmitter (uart)? (ds70000582) in the ?dspic33/pic24 family reference manual? for information on enabling the uart1 module for transmit operation. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 199 dspic33epxxgs202 family 19.0 high-speed, 12-bit analog-to-digital converter (adc) the dspic33epxxgs202 devices have a high- speed, 12-bit analog-to-digital converter (adc) that features a low conversion latency, high resolution and oversampling capabilities to improve performance in ac/dc, dc/dc power converters. 19.1 features overview the 12-bit high speed multiple sars analog-to-digital converter (adc) includes the following features: 12-bit resolution up to 3.25 msps conversion rate per adc core @ 12-bit resolution multiple dedicated adc cores one shared (common) adc core up to 12 analog input sources conversion result can be formatted as unsigned or signed data on a per channel basis for all channels separate 16-bit conversion result register for each analog input simultaneous sampling of up to 3 analog inputs flexible trigger options early interrupt generation to enable fast processing of converted data two integrated digital comparators: - multiple comparison options - assignable to specific analog inputs oversampling filters: - provides increased resolution - assignable to a specific analog input operation during cpu sleep and idle modes simplified block diagrams of the multiple sars 12-bit adc are shown in figure 19-1 , figure 19-2 and figure 19-3 . the module consists of two independent sar adc cores. the analog inputs (channels) are connected through multiplexers and switches to the sample-and- hold (s/h) circuit of each adc core. the core uses the channel information (the output format, the measure- ment mode and the input number) to process the analog sample. when conversion is complete, the result is stored in the result buffer for the specific analog input and passed to the digital filter and digital comparator if they were configured to use data from this particular channel. the adc module can sample up to three inputs at a time (two inputs from the dedicated sar adc cores and one from the shared sar adc cores). if multiple adc inputs request conversion, the adc module will convert them in a sequential manner, starting with the lowest order input. the adc provides each analog input the ability to specify its own trigger source. this capability allows the adc to sample and convert analog inputs that are associated with pwm generators operating on independent time bases. note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?12-bit high-speed, multiple sars a/d converter (adc) (ds70005213) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 200 ? 2015-2016 microchip technology inc. figure 19-1: adc module block diagram voltage reference clock selection (clksel<1:0> bits) divider (clkdiv<5:0> bits) av dd av ss instruction clock frc aux reference reference reference output data clock clock clock output data output data digital comparator 0 adcmp0 interrupt digital comparator 1 adcmp1 interrupt adfl0dat adcbuf0 adcbuf1 adcbuf14 adcan0 interrupt adcan1 interrupt adcan14 interrupt adfl0 interrupt dedicated an1 an2 an11 v ref _band gap (1) pga1 (1) pga2 (1) pga1 (1) pga2 (1) an7 an0 adc core 1 (3) an8 dedicated adc core 0 (3) shared adc core (2) clock f osc digital filter 0 note 1: pga1, pga2 and v ref _band gap are internal analog inputs and are not available on device pins. 2: shared adc core does not suppor t pseudo-differential operation. 3: if the dedicated core uses an alternate channel, then shared core function cannot be used. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 201 dspic33epxxgs202 family figure 19-2: dedicated adc core 0-1 block diagram figure 19-3: shared adc core block diagram sample- and-hold 12-bit sar adc positive input alternate positive input av ss + C adc core clock divider (adcs<6:0> bits) reference output data clock trigger stops sampling negative input positive input selection (cxchs<1:0> bits) selection (diffx bit) negative input pga1 (1) pga2 (1) note 1: pga1 and pga2 are internal analog inputs and are not available on device pins. shared sample- and-hold an2 an11 av ss + analog channel number from current trigger 12-bit sar adc reference clock output data sampling time is defined by shrsamc<9:0> bits v ref _band gap (1) adc core clock divider (shradcs<6:0> bits) note 1: v ref _band gap is an internal analog input and is not available on device pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 202 ? 2015-2016 microchip technology inc. 19.2 analog-to-digital converter resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 19.2.1 key resources ?12-bit high-speed, multiple sars a/d converter (adc) (ds70005213) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools register 19-1: adcon1l: adc control register 1 low r/w-0 u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 adon ( 1 ) a d s i d l bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 adon: adc enable bit ( 1 ) 1 = adc module is enabled 0 = adc module is off bit 14 unimplemented: read as 0 bit 13 adsidl: adc stop in idle mode bit 1 = discontinues module operation when device enters idle mode 0 = continues module operation in idle mode bit 12-0 unimplemented: read as 0 note 1: set the adon bit only after the adc module has been configured. changing adc configuration bits when adon = 1 will result in unpredictable behavior. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 203 dspic33epxxgs202 family register 19-2: adcon1h: adc control register 1 high u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 r/w-0 r/w-1 r/w-1 u-0 u-0 u-0 u-0 u-0 form shrres1 shrres0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-8 unimplemented: read as 0 bit 7 form: fractional data output format bit 1 = fractional 0 = integer bit 6-5 shrres<1:0>: shared adc core resolution selection bits 11 = 12-bit resolution 10 = 10-bit resolution 01 = 8-bit resolution 00 = 6-bit resolution bit 4-0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 204 ? 2015-2016 microchip technology inc. register 19-3: adcon2l: adc control register 2 low r/w-0 r/w-0 u-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 refcie refercie ( 2 ) e i e n shreisel2 ( 1 ) shreisel1 ( 1 ) shreisel0 ( 1 ) bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 shradcs6 shradcs5 shradcs4 shradcs3 shradcs2 shradcs1 shradcs0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 refcie: band gap and reference voltage ready common interrupt enable bit 1 = common interrupt will be generated when the band gap will become ready 0 = common interrupt is disabled for the band gap ready event bit 14 refercie: band gap or reference voltage error common interrupt enable bit ( 2 ) 1 = common interrupt will be generated when the band gap or reference voltage error is detected 0 = common interrupt is disabled for the band gap and reference voltage error event bit 13 unimplemented: read as 0 bit 12 eien: early interrupts enable bit 1 = the early interrupt feature is enabled for the input channels interrupts (when eistatx flag is set) 0 = the individual interrupts are generated when conversion is done (when anxrdy flag is set) bit 11 unimplemented: read as 0 bit 10-8 shreisel<2:0>: shared core early interrupt time selection bits ( 1 ) 111 = early interrupt is set and interrupt is generated 8 t adcore clocks prior to when the data is ready 110 = early interrupt is set and interrupt is generated 7 t adcore clocks prior to when the data is ready 101 = early interrupt is set and interrupt is generated 6 t adcore clocks prior to when the data is ready 100 = early interrupt is set and interrupt is generated 5 t adcore clocks prior to when the data is ready 011 = early interrupt is set and interrupt is generated 4 t adcore clocks prior to when the data is ready 010 = early interrupt is set and interrupt is generated 3 t adcore clocks prior to when the data is ready 001 = early interrupt is set and interrupt is generated 2 t adcore clocks prior to when the data is ready 000 = early interrupt is set and interrupt is generated 1 t adcore clock prior to when the data is ready bit 7 unimplemented: read as 0 bit 6-0 shradcs<6:0>: shared adc core input clock divider bits these bits determine the number of t coresrc (core source clock) periods for one shared t adcore (adc core clock) period. 1111111 = 254 core source clock periods 0000011 = 6 core source clock periods 0000010 = 4 core source clock periods 0000001 = 2 core source clock periods 0000000 = 2 core source clock periods note 1: for the 6-bit shared adc core resolution (shrres<1:0> = 00 ), the shreisel<2:0> settings, from 100 to 111 , are not valid and should not be used. for the 8-bit shared adc core resolution (shrres<1:0> = 01 ), the shreisel<2:0> settings, 110 and 111 , are not valid and should not be used. 2: to avoid false interrupts, the refercie bit must be set only after the module is enabled (adon = 1 ). downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 205 dspic33epxxgs202 family register 19-4: adcon2h: adc control register 2 high r-0, hs, hc r-0, hs, hc u-0 u-0 u-0 u-0 r/w-0 r/w-0 refrdy referr shrsamc9 shrsamc8 bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 shrsamc7 shrsamc6 shrsamc5 shrsamc4 shrsamc3 shrsamc2 shrsamc1 shrsamc0 bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 refrdy: band gap and reference voltage ready flag bit 1 = band gap is ready 0 = band gap is not ready bit 14 referr: band gap or reference voltage error flag bit 1 = band gap was removed after the adc module was enabled (adon = 1 ) 0 = no band gap error was detected bit 13-10 unimplemented: read as 0 bit 9-0 shrsamc<9:0>: shared adc core sample time selection bits these bits specify the number of shared adc core clock (t adcore ) periods for the shared adc core sample time. 1111111111 = 1025 t adcore 0000000001 = 3 t adcore 0000000000 = 2 t adcore downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 206 ? 2015-2016 microchip technology inc. register 19-5: adcon3l: adc control register 3 low r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r-0, hs, hc r/w-0 r-0, hs, hc refsel2 refsel1 refsel0 suspend suspcie susprdy shrsamp cnvrtch bit 15 bit 8 r/w-0 r-0, hs, hc r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 swlctrg swctrg cnvchsel5 cnvchsel4 cnvchsel3 cnvchsel2 cnvchsel1 cnvchsel0 bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 refsel<2:0>: adc reference voltage selection bits 001 - 111 = unimplemented: should not be used bit 12 suspend: all adc cores triggers disable bit 1 = all new triggers events for all adc cores are disabled 0 = all adc cores can be triggered bit 11 suspcie: suspend all adc cores common interrupt enable bit 1 = common interrupt will be generated when adc cores triggers are suspended (suspend bit = 1 ) and all previous conversions are finished (susprdy bit becomes set) 0 = common interrupt is not generated for suspend adc cores event bit 10 susprdy: all adc cores suspended flag bit 1 = all adc cores are suspended (suspend bit = 1 ) and have no conversions in progress 0 = adc cores have previous conversions in progress bit 9 shrsamp: shared adc core sampling direct control bit this bit should be used with the individual channel conversion trigger controlled by the cnvrtch bit. it connects an analog input, specified by cnvchsel<5:0> bits, to the shared adc core and allows extend- ing the sampling time. this bit is not controlled by hardware and must be cleared before the conversi on starts (setting cnvrtch to 1 ). 1 = shared adc core samples an analog input specified by the cnvchsel<5:0> bits 0 = sampling is controlled by the shared adc core hardware bit 8 cnvrtch: software individual channel conversion trigger bit 1 = single trigger is generated for an analog input specified by the cnvchsel<5:0> bits. when the bit is set, it is automatically cleared by hardware on the next instruction cycle. 0 = next individual channel conversion trigger can be generated bit 7 swlctrg: software level-sensitive common trigger bit 1 = triggers are continuously generated for all channels with the software, level-sensit ive, common trigger selected as a source in the adtrigxl and adtrigxh registers 0 = no software, level-sensitive, common triggers are generated bit 6 swctrg: software common trigger bit 1 = single trigger is generated for all channels with the software, common trigger selected as a source in the adtrigxl and adtrigxh registers. when the bit is set, it is automatically cleared by hardware on the next instruction cycle 0 = ready to generate the next software, common trigger bit 5-0 cnvchsel <5:0>: channel number selection for software individual channel conversion trigger bits these bits define a channel to be converted when the cnvrtch bit is set. value v refh v refl 000 av dd av ss downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 207 dspic33epxxgs202 family register 19-6: adcon3h: adc control register 3 high r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 clksel1 clksel0 clkdiv5 clkdiv4 clkdiv3 clkdiv2 clkdiv1 clkdiv0 bit 15 bit 8 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 shren c 1 e nc 0 e n bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-14 clksel<2:0>: adc module clock source selection bits 11 = apll 10 = frc 01 = f osc (system clock x 2) 00 = f sys (system clock) bit 13-8 clkdiv<5:0>: adc module clock source divider bits the divider forms a t coresrc clock used by all adc cores (shared and dedicated) from the t src adc module clock source selected by the clksel<2:0> bits. then, each adc core individually d ivides the t coresrc clock to get a core-specific t adcore clock using the adcs<6:0> bits in the adcorexh register or the shradcs<6:0> bits in the adcon2l register. 111111 = 64 core source clock periods 000011 = 4 core source clock periods 000010 = 3 core source clock periods 000001 = 2 core source clock periods 000000 = 1 core source clock period bit 7 shren: shared adc core enable bit this bit does not disable the core clock and analog bias circuitry. 1 = shared adc core is enabled 0 = shared adc core is disabled bit 6-2 unimplemented: read as 0 bit 1-0 c1en:c0en: dedicated adc core x enable bits this bit does not disable the core clock and analog bias circuitry. 1 = dedicated adc core x is enabled 0 = dedicated adc core x is disabled downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 208 ? 2015-2016 microchip technology inc. register 19-7: adcon4l: adc control register 4 low u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 synctrg1 ( 1 ) synctrg0 ( 1 ) bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 samc1en samc0en bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as 0 bit 9-8 synctrg<1:0> dedicated adc core x trigger synchronization bits ( 1 ) 1 = all triggers are synchronized with the core source clock (t coresrc ) 0 = the adc core triggers are not synchronized bit 7-2 unimplemented: read as 0 bit 1-0 samc1en:samc0en: dedicated adc core x conversion delay enable bits 1 = after trigger, the conversion will be delayed and the adc core will continue sampli ng during the time specified by the samc<9:0> bits in the adcorexl register 0 = after trigger, the sampling will be stopped immediately and the conversion will be started on the next core clock cycle. note 1: for proper adc performance, this bit must be set when using level-sensitive triggers and cleared for edge-sensitive triggers. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 209 dspic33epxxgs202 family register 19-8: adcon4h: adc control register 4 high u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 c1chs1 c1chs0 c0chs1 c0chs0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-4 unimplemented: read as 0 bit 3-2 c1chs<1:0>: dedicated adc core 1 input channel selection bits 11 = pga2 10 = pga1 01 = an8 00 = an1 an8 is a negative input when diff1 (admod0l<3>) = 1 . bit 1-0 c0chs<1:0>: dedicated adc core 0 input channel selection bits 11 = pga2 10 = pga1 01 = an7 00 = an0 an7 is a negative input when diff0 (admod0l<1>) = 1 . downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 210 ? 2015-2016 microchip technology inc. register 19-9: adcon5l: adc control register 5 low r-0, hc, hs u-0 u-0 u-0 u-0 u-0 r-0, hc, hs r-0, hc, hs shrrdy c1rdy c0rdy bit 15 bit 8 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 shrpwr c 1 p w rc 0 p w r bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 shrrdy: shared adc core ready flag bit 1 = adc core is powered and ready for operation 0 = adc core is not ready for operation bit 14-10 unimplemented: read as 0 bit 9-8 c1rdy:c0rdy: dedicated adc core x ready flag bits 1 = adc core x is powered and ready for operation 0 = adc core x is not ready for operation bit 7 shrpwr: shared adc core x power enable bit 1 = adc core x is powered 0 = adc core x is off bit 6-2 unimplemented: read as 0 bit 1-0 c1pwr:c0pwr: dedicated adc core x power enable bits 1 = adc core x is powered 0 = adc core x is off downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 211 dspic33epxxgs202 family register 19-10: adcon5h: a dc control register 5 high u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 warmtime3 warmtime2 warmtime1 warmtime0 bit 15 bit 8 r/w-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 shrcie c1cie c0cie bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as 0 bit 11-8 warmtime<3:0>: adc cores power-up delay bits these bits determine the power-up delay in the number of the core source clock (t coresrc ) periods for all adc cores. 1111 = 32768 core source clock periods 1110 = 16384 core source clock periods 1101 = 8192 core source clock periods 1100 = 4096 core source clock periods 1011 = 2048 core source clock periods 1010 = 1024 core source clock periods 1001 = 512 core source clock periods 1000 = 256 core source clock periods 0111 = 128 core source clock periods 0110 = 64 core source clock periods 0101 = 32 core source clock periods 0000 - 0100 = 16 core source clock periods bit 7 shrcie: shared adc core ready common interrupt enable bit 1 = common interrupt will be generated when adc core is powered and ready for operation 0 = common interrupt is disabled for an adc core ready event bit 6-2 unimplemented: read as 0 bit 1-0 c1cie:c0cie: dedicated adc core x ready common interrupt enable bits 1 = common interrupt will be generated when adc core x is powered and ready for operation 0 = common interrupt is disabled for an adc core x ready event downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 212 ? 2015-2016 microchip technology inc. register 19-11: adcorexl: dedicated adc core x control register low (x = 0 , 1 ) u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 s a m c < 9 : 8 > bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 samc<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-10 unimplemented: read as 0 bit 9-0 samc<9:0>: dedicated adc core x conversion delay selection bits these bits determine the time between the trigger event and the start of conversion in the number of the adc core clock (t adcore ) periods. during this time, the adc core x still continues sampling. this feature is enabled by the samcxen bit in the adcon4l register. 1111111111 = 1025 t adcore 0000000001 = 3 t adcore 0000000000 = 2 t adcore downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 213 dspic33epxxgs202 family register 19-12: adcorexh: dedicated adc core x control register high (x = 0 , 1 ) u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 e i s e l 2 ( 1 ) eisel1 ( 1 ) eisel0 ( 1 ) res1 res0 bit 15 bit 8 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcs6 adcs5 adcs4 adcs3 adcs2 adcs1 adcs0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12-10 eisel<2:0>: adc core x early interrupt time selection bits ( 1 ) 111 = early interrupt is set and an interrupt is generated 8 t adcore clocks prior to when the data is ready 110 = early interrupt is set and an interrupt is generated 7 t adcore clocks prior to when the data is ready 101 = early interrupt is set and an interrupt is generated 6 t adcore clocks prior to when the data is ready 100 = early interrupt is set and an interrupt is generated 5 t adcore clocks prior to when the data is ready 011 = early interrupt is set and an interrupt is generated 4 t adcore clocks prior to when the data is ready 010 = early interrupt is set and an interrupt is generated 3 t adcore clocks prior to when the data is ready 001 = early interrupt is set and an interrupt is generated 2 t adcore clocks prior to when the data is ready 000 = early interrupt is set and an interrupt is generated 1 t adcore clock prior to when the data is ready bit 9-8 res<1:0>: adc core x resolution selection bits 11 = 12-bit resolution 10 = 10-bit resolution 01 = 8-bit resolution 00 = 6-bit resolution bit 7 unimplemented: read as 0 bit 6-0 adcs<6:0>: adc core x input clock divider bits these bits determine the number of core source clock (t coresrc ) periods for one adc core clock (t adcore ) period. 1111111 = 254 core source clock periods 0000011 = 6 core source clock periods 0000010 = 4 core source clock periods 0000001 = 2 core source clock periods 0000000 = 2 core source clock periods note 1: for the 6-bit adc core resolution (res<1:0> = 00 ), the eisel<2:0> bits settings, from 100 to 111 , are not valid and should not be used. for the 8-bit adc core resolution (res<1:0> = 01 ), the eisel<2:0> bits settings, 110 and 111 , are not valid and should not be used. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 214 ? 2015-2016 microchip technology inc. register 19-13: adlvltrgl: adc level-sen sitive trigger control register low u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 lvlen14 lvlen<11:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 lvlen<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 lvlen14: level trigger 14 enable bit 1 = input channel 14 trigger is level-sensitive 0 = input channel 14 trigger is edge-sensitive bit 13-12 unimplemented: read as 0 bit 11-0 lvlen<11:0>: level trigger x enable bits 1 = input channel x trigger is level-sensitive 0 = input channel x trigger is edge-sensitive downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 215 dspic33epxxgs202 family register 19-14: adeiel: adc early interrupt enable register low u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 e i e n 1 4 eien<11:8> bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 eien<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 eien14: early interrupt enable for corresponding analog inputs bit 1 = early interrupt is enabled for the channel 0 = early interrupt is disabled for the channel bit 13-12 unimplemented: read as 0 bit 11-0 eien<11:0>: early interrupt enable for corresponding analog inputs bits 1 = early interrupt is enabled for the channel 0 = early interrupt is disabled for the channel register 19-15: adeistatl: adc early interrupt status register low u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 e i s t a t 1 4 e i s t a t < 1 1 : 8 > bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 eistat<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 eistat14: early interrupt status for corresponding analog inputs bit 1 = early interrupt was generated 0 = early interrupt was not generated since the last adcbufx read bit 13-12 unimplemented: read as 0 bit 11-0 eistat<11:0>: early interrupt status for corresponding analog inputs bits 1 = early interrupt was generated 0 = early interrupt was not generated since the last adcbufx read downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 216 ? 2015-2016 microchip technology inc. register 19-16: admod0l: adc inpu t mode control register 0 low u-0 r/w-0 u-0 r/w-0 u-0 r/w-0 u-0 r/w-0 s i g n 7 s i g n 6 s i g n 5 s i g n 4 bit 15 bit 8 u-0 r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 s i g n 3 sign2 diff1 sign1 diff0 sign0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit (odd)15-5 unimplemented: read as 0 bit (3,1) diff: pseudo-differential mode for corresponding analog inputs bits 1 = channel is pseudo-differential 0 = channel is single-ended bit (even) signx: output data sign for corresponding analog inputs bits 1 = channel output data is signed 0 = channel output data is unsigned register 19-17: admod0h: adc input mode control register 0 high u-0 u-0 u-0 r/w-0 u-0 r/w-0 u-0 r/w-0 s i g n 1 4 s i g n 1 3 s i g n 1 2 bit 15 bit 8 u-0 r/w-0 u-0 r/w-0 u-0 r/w-0 u-0 r/w-0 s i g n 1 1 s i g n 1 0 s i g n 9 s i g n 8 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit (odd) unimplemented: read as 0 bit (even) sign: output data sign for corresponding analog inputs bits 1 = channel output data is signed 0 = channel output data is unsigned downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 217 dspic33epxxgs202 family register 19-18: adiel: adc interrupt enable register low u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 i e 1 4 i e < 1 1 : 8 > bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ie<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 ie14: common interrupt enable bit 1 = common and individual interrupt is enabled for the corresponding channel 0 = common and individual interrupt is disabled for the corresponding channel bit 13-12 unimplemented: read as 0 bit 11-0 ie<11:0>: common interrupt enable bits 1 = common and individual interrupts are enabled for the corresponding channel 0 = common and individual interrupts are disabled for the corresponding channel register 19-19: adstatl: adc data ready status register low u-0 r-0, hc, hs u-0 u-0 r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs an14rdy an11rdy an10rdy an9rdy an8rdy bit 15 bit 8 r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs an7rdy an6rdy an5rdy an4rdy an3rdy an2rdy an1rdy an0rdy bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 an14rdy: adc conversion data ready for corresponding analog input bit 1 = channel conversion result is ready in the corresponding adcbufx register 0 = channel conversion result is not ready bit 13-12 unimplemented: read as 0 bit 11-0 an11rdy:an0rdy: adc conversion data ready for corresponding analog input bits 1 = channel conversion result is ready in the corresponding adcbufx register 0 = channel conversion result is not ready downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 218 ? 2015-2016 microchip technology inc. register 19-20: adtrigxl: adc channel trigger x selection register low (x = 0 to 3) u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgsrc(4x+1)<4:0> bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgsrc(4x)<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12-8 trgsrc(4x+1)<4:0>: trigger source selection for corresponding analog inputs bits 11111 = adtrg31 11110 = reserved 11101 = reserved 11100 = reserved 11011 = reserved 11010 = pwm generator 3 current-limit trigger 11001 = pwm generator 2 current-limit trigger 11000 = pwm generator 1 current-limit trigger 10111 = reserved 10110 = output compare 1 trigger 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = pwm generator 3 secondary trigger 10000 = pwm generator 2 secondary trigger 01111 = pwm generator 1 secondary trigger 01110 = pwm secondary special event trigger 01101 = timer2 period match 01100 = timer1 period match 01011 = reserved 01010 = reserved 01001 = reserved 01000 = reserved 00111 = pwm generator 3 primary trigger 00110 = pwm generator 2 primary trigger 00101 = pwm generator 1 primary trigger 00100 = pwm special event trigger 00011 = reserved 00010 = level software trigger 00001 = common software trigger 00000 = no trigger is enabled bit 7-5 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 219 dspic33epxxgs202 family bit 4-0 trgsrc(4x)<4:0>: trigger source selection for corresponding analog inputs bits 11111 = adtrg31 11110 = reserved 11101 = reserved 11100 = reserved 11011 = reserved 11010 = pwm generator 3 current-limit trigger 11001 = pwm generator 2 current-limit trigger 11000 = pwm generator 1 current-limit trigger 10111 = reserved 10110 = output compare 1 trigger 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = pwm generator 3 secondary trigger 10000 = pwm generator 2 secondary trigger 01111 = pwm generator 1 secondary trigger 01110 = pwm secondary special event trigger 01101 = timer2 period match 01100 = timer1 period match 01011 = reserved 01010 = reserved 01001 = reserved 01000 = reserved 00111 = pwm generator 3 primary trigger 00110 = pwm generator 2 primary trigger 00101 = pwm generator 1 primary trigger 00100 = pwm special event trigger 00011 = reserved 00010 = level software trigger 00001 = common software trigger 00000 = no trigger is enabled register 19-20: adtrigxl: adc channel trigger x selection register low (x = 0 to 3) (continued) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 220 ? 2015-2016 microchip technology inc. register 19-21: adtrigxh: adc channel trigger x selection register high (x = 0 to 3) u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgsrc(4x+3)<4:0> bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 trgsrc(4x+2)<4:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12-8 trgsrc(4x+3)<4:0>: trigger source selection for corresponding analog inputs bits 11111 = adtrg31 11110 = reserved 11101 = reserved 11100 = reserved 11011 = reserved 11010 = pwm generator 3 current-limit trigger 11001 = pwm generator 2 current-limit trigger 11000 = pwm generator 1 current-limit trigger 10111 = reserved 10110 = output compare 1 trigger 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = pwm generator 3 secondary trigger 10000 = pwm generator 2 secondary trigger 01111 = pwm generator 1 secondary trigger 01110 = pwm secondary special event trigger 01101 = timer2 period match 01100 = timer1 period match 01011 = reserved 01010 = reserved 01001 = reserved 01000 = reserved 00111 = pwm generator 3 primary trigger 00110 = pwm generator 2 primary trigger 00101 = pwm generator 1 primary trigger 00100 = pwm special event trigger 00011 = reserved 00010 = level software trigger 00001 = common software trigger 00000 = no trigger is enabled bit 7-5 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 221 dspic33epxxgs202 family bit 4-0 trgsrc(4x+2)<4:0>: trigger source selection for corresponding analog inputs bits 11111 = adtrg31 11110 = reserved 11101 = reserved 11100 = reserved 11011 = reserved 11010 = pwm generator 3 current-limit trigger 11001 = pwm generator 2 current-limit trigger 11000 = pwm generator 1 current-limit trigger 10111 = reserved 10110 = output compare 1 trigger 10101 = reserved 10100 = reserved 10011 = reserved 10010 = reserved 10001 = pwm generator 3 secondary trigger 10000 = pwm generator 2 secondary trigger 01111 = pwm generator 1 secondary trigger 01110 = pwm secondary special event trigger 01101 = timer2 period match 01100 = timer1 period match 01011 = reserved 01010 = reserved 01001 = reserved 01000 = reserved 00111 = pwm generator 3 primary trigger 00110 = pwm generator 2 primary trigger 00101 = pwm generator 1 primary trigger 00100 = pwm special event trigger 00011 = reserved 00010 = level software trigger 00001 = common software trigger 00000 = no trigger is enabled register 19-21: adtrigxh: adc channel trigger x selection register high (x = 0 to 3) (continued) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 222 ? 2015-2016 microchip technology inc. register 19-22: adcal0l: adc calibration register 0 low r-0, hc, hs u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 cal1rdy cal1skip cal1diff cal1en cal1run bit 15 bit 8 r-0, hc, hs u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 cal0rdy cal0skip cal0diff cal0en cal0run bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 cal1rdy: dedicated adc core 1 calibration status flag bit 1 = dedicated adc core 1 calibration is finished 0 = dedicated adc core 1 calibration is in progress bit 14-12 unimplemented: read as 0 bit 11 cal1skip: dedicated adc core 1 calibration bypass bit 1 = after power-up, the dedicated adc core 1 will not be calibrated 0 = after power-up, the dedicated adc core 1 will be calibrated bit 10 cal1diff: dedicated adc core 1 pseudo-differential input mode calibration bit 1 = dedicated adc core 1 will be calibrated in pseudo-differential input mode 0 = dedicated adc core 1 will be calibrated in single-ended input mode bit 9 cal1en: dedicated adc core 1 calibration enable bit 1 = dedicated adc core 1 calibration bits (calxrdy, calxskip, calxdiff and calx run) can be accessed by software 0 = dedicated adc core 1 calibration bits are disabled bit 8 cal1run: dedicated adc core 1 calibration start bit 1 = if this bit is set by software, the dedicated adc core 1 calibration cycle is started; this bit is automatically cleared by hardware 0 = software can start the next calibration cycle bit 7 cal0rdy: dedicated adc core 0 calibration status flag bit 1 = dedicated adc core 0 calibration is finished 0 = dedicated adc core 0 calibration is in progress bit 6-4 unimplemented: read as 0 bit 3 cal0skip: dedicated adc core 0 calibration bypass bit 1 = after power-up, the dedicated adc core 0 will not be calibrated 0 = after power-up, the dedicated adc core 0 will be calibrated bit 2 cal0diff: dedicated adc core 0 pseudo-differential input mode calibration bit 1 = dedicated adc core 0 will be calibrated in pseudo-differential input mode 0 = dedicated adc core 0 will be calibrated in single-ended input mode bit 1 cal0en: dedicated adc core 0 calibration enable bit 1 = dedicated adc core 0 calibration bits (calxrdy, calxskip, calxdiff and calx run) can be accessed by software 0 = dedicated adc core 0 calibration bits are disabled bit 0 cal0run: dedicated adc core 0 calibration start bit 1 = if this bit is set by software, the dedicated adc core 0 calibration cycle is started; this bit is automatically cleared by hardware 0 = software can start the next calibration cycle downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 223 dspic33epxxgs202 family register 19-23: adcal1h: adc cal ibration register 1 high r/w-0, hs u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 cshrrdy cshrskip cshrdiff cshren cshrrun bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 7 bit 0 legend: hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 cshrrdy: shared adc core calibration status flag bit 1 = shared adc core calibration is finished 0 = shared adc core calibration is in progress bit 14-12 unimplemented: read as 0 bit 11 cshrskip: shared adc core calibration bypass bit 1 = after power-up, the shared adc core will not be calibrated 0 = after power-up, the shared adc core will be calibrated bit 10 cshrdiff: shared adc core pseudo-differential input mode calibration bit 1 = shared adc core will be calibrated in pseudo-differential input mode 0 = shared adc core will be calibrated in single-ended input mode bit 9 cshren: shared adc core calibration enable bit 1 = shared adc core calibration bits (cshrrdy, cshrskip, cshrdiff and cshrrun) can be accessed by software 0 = shared adc core calibration bits are disabled bit 8 cshrrun: shared adc core calibration start bit 1 = if this bit is set by software, the shared adc core calibration cycle is started; this bit is cleared aut o- matically by hardware 0 = software can start the next calibration cycle bit 7-0 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 224 ? 2015-2016 microchip technology inc. register 19-24: adcmpxcon: adc digital comparator x control register (x = 0 , 1 ) u-0 u-0 u-0 r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs r-0, hc, hs chnl4 chnl3 chnl2 chnl1 chnl0 bit 15 bit 8 r/w/0 r/w-0 r-0, hc, hs r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cmpen ie stat btwn hihi hilo lohi lolo bit 7 bit 0 legend: hs = hardware settable bit hc = hardware clearable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-13 unimplemented: read as 0 bit 12-8 chnl<4:0>: input channel number bits if the comparator has detected an event for a channel, this channel number is written to these bits. 01111 - 11111 = reserved 01110 = an14 00001 = an1 00000 = an0 bit 7 cmpen: digital comparator enable bit 1 = digital comparator is enabled 0 = digital comparator is disabled and the stat status bit is cleared bit 6 ie: comparator common adc interrupt enable bit 1 = common adc interrupt will be generated if the comparator detects a comparison event 0 = common adc interrupt will not be generated for the comparator bit 5 stat: comparator event status bit this bit is cleared by hardware when the channel number is read from the chnl<4:0> bits. 1 = a comparison event has been detected since the last read of the chnl <4:0> bits 0 = a comparison event has not been detected since the last read of t he chnl<4:0> bits bit 4 btwn: between low/high comparator event bit 1 = generates a digital comparator event when adcmpxlo adcbufx < adcmpxhi 0 = does not generate a digital comparator event when adcmpxlo adcbufx < adcmpxhi bit 3 hihi: high/high comparator event bit 1 = generates a digital comparator event when adcbufx adcmpxhi 0 = does not generate a digital comparator event when adcbufx adcmpxhi bit 2 hilo: high/low comparator event bit 1 = generates a digital comparator event when adcbufx < adcmpxhi 0 = does not generate a digital comparator event when adcbufx < adcmpxhi bit 1 lohi: low/high comparator event bit 1 = generates a digital comparator event when adcbufx adcmpxlo 0 = does not generate a digital comparator event when adcbufx adcmpxlo bit 0 lolo: low/low comparator event bit 1 = generates a digital comparator event when adcbufx < adcmpxlo 0 = does not generate a digital comparator event when adcbufx < adcmpxlo downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 225 dspic33epxxgs202 family register 19-25: adcmpxenl: adc digital comparator x channel enable register low (x = 0 , 1 ) u-0 r/w-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 cmpen14 cmpen<11:8> bit 15 bit 8 r/w/0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cmpen<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 unimplemented: read as 0 bit 14 cmpen14: comparator enable for corresponding input channel bit 1 = conversion result for corresponding channel is used by the comparator 0 = conversion result for corresponding channel is not used by the comparator bit 13-12 unimplemented: read as 0 bit 11-0 cmpen<11:0>: comparator enable for corresponding input channels bits 1 = conversion result for corresponding channel is used by the comparator 0 = conversion result for corresponding channel is not used by the comparator downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 226 ? 2015-2016 microchip technology inc. register 19-26: adfl0con: adc di gital filter 0 control register r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r-0, hc, hs flen mode1 mode0 ovrsam2 ovrsam1 ovrsam0 ie rdy bit 15 bit 8 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 flchsel4 flchsel3 flchsel2 flchsel1 flchsel0 bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 flen: filter enable bit 1 = filter is enabled 0 = filter is disabled and the rdy bit is cleared bit 14-13 mode<1:0>: filter mode bits 11 = averaging mode 10 = reserved 01 = reserved 00 = oversampling mode bit 12-10 ovrsam<2:0>: filter averaging/oversampling ratio bits if mode<1:0> = 00 : 111 = 128x (16-bit result in the adfl0dat register is in 12.4 format) 110 = 32x (15-bit result in the adfl0dat register is in 12.3 format) 101 = 8x (14-bit result in the adfl0dat register is in 12.2 format) 100 = 2x (13-bit result in the adfl0dat register is in 12.1 format) 011 = 256x (16-bit result in the adfl0dat register is in 12.4 format) 010 = 64x (15-bit result in the adfl0dat register is in 12.3 format) 001 = 16x (14-bit result in the adfl0dat register is in 12.2 format) 000 = 4x (13-bit result in the adfl0dat register is in 12.1 format) if mode<1:0> = 11 (12-bit result in the adfl0dat register): 111 = 256x 110 = 128x 101 = 64x 100 = 32x 011 = 16x 010 = 8x 001 = 4x 000 = 2x bit 9 ie: filter common adc interrupt enable bit 1 = common adc interrupt will be generated when the filter result will be ready 0 = common adc interrupt will not be generated for the filter bit 8 rdy: oversampling filter data ready flag bit this bit is cleared by hardware when the result is read from the adfl0dat register. 1 = data in the adfl0dat register is ready 0 = the adfl0dat register has been read and new data in the adfl0dat register is not ready bit 7-5 unimplemented: read as 0 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 227 dspic33epxxgs202 family bit 4-0 flchsel<4:0>: oversampling filter input channel selection bits 01111 - 11111 = reserved 01110 = an14 00001 = an1 00000 = an0 register 19-26: adfl0con: adc digital filter 0 control register (continued) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 228 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 229 dspic33epxxgs202 family 20.0 high-speed analog comparator the high-speed analog comparator module monitors current and/or voltage transients that may be too fast for the cpu and adc to capture. 20.1 features overview the smps comparator module offers the following major features: two rail-to-rail analog comparators dedicated 12-bit dac for each analog comparator up to six selectable input sources per comparator: - four external inputs - two internal inputs from the pgax module programmable comparator hysteresis programmable output polarity voltage references for the dacx: -av dd interrupt generation capability functional support for pwm: - pwm duty cycle control - pwm period control - pwm fault detected note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?high-speed analog comparator module? (ds70005128) in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 230 ? 2015-2016 microchip technology inc. 20.2 module description figure 20-1 shows a functional block diagram of one analog comparator from the high-speed analog comparator module. the analog comparator provides high-speed operation with a typical delay of 15 ns. the negative input of the comparator is always connected to the dacx circuit. the positive input of the compara- tor is connected to an analog multiplexer that selects the desired source pin. the analog comparator input pins are typically shared with pins used by the analog-to-digital converter (adc) module. both the comparator and the adc can use the same pins at the same time. this capability enables a user to measure an input voltage with the adc and detect voltage transients with the comparator. figure 20-1: high-speed analog comp arator x module block diagram cmpxa (1) cmpxc (1) dacx (1) cmppol 01 cmref<11:0> cmpx (1) insel<1:0> 12 interrupt cmpxb (1) cmpxd (1) pulse stretcher pwm trigger and note 1: x = 1-2 status digital filter pga1out pga2out mux altinp (remappable i/o) request av dd downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 231 dspic33epxxgs202 family 20.3 module applications this module provides a means for the smps dspic ? dsc devices to monitor voltage and currents in a power conversion application. the ability to detect transient conditions, and stimulate the dspic dsc processor and/or peripherals, without requiring the processor and adc to constantly monitor voltages or currents, frees the dspic dsc to perform other tasks. the comparator module has a high-speed comparator and an associated 12-bit dac that provides a pro- grammable reference voltage to the inverting input of the comparator. the polarity of the comparator output is user-programmable. the output of the module can be used in the following modes: generate an interrupt trigger an adc sample and convert process truncate the pwm signal (current-limit) truncate the pwm period (current minimum) disable the pwm outputs (fault latch) the output of the comparator module may be used in multiple modes at the same time, such as: 1) generate an interrupt, 2) have the adc take a sample and con- vert it, and 3) truncate the pwm output in response to a voltage being detected beyond its expected value. the comparator module can also be used to wake-up the system from sleep or idle mode when the analog input voltage exceeds the programmed threshold voltage. 20.4 dac each analog comparator has a dedicated 12-bit dac that is used to program the comparator threshold voltage via the cmpxdac register. 20.5 pulse stretcher and digital logic the analog comparator can respond to very fast transient signals. after the comparator output is given the desired polarity, the signal is passed to a pulse stretching circuit. the pulse stretching circuit has an asynchronous set function and a delay circuit that ensures the minimum pulse width is three system clock cycles wide to allow the attached circuitry to properly respond to a narrow pulse event. the pulse stretcher circuit is followed by a digital filter. the digital filter is enabled via the fltren bit in the cmpxcon register. the digital filter operates with the clock specified via the fclksel bit in the cmpxcon register. the comparator signal must be stable in a high or low state, for at least three of the selected clock cycles, for it to pass through the digital filter. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 232 ? 2015-2016 microchip technology inc. 20.6 hysteresis an additional feature of the module is hysteresis con- trol. hysteresis can be enabled or disabled and its amplitude can be controlled by the hyssel<1:0> bits in the cmpxcon register. three different values are available: 5 mv, 10 mv and 20 mv. it is also possible to select the edge (rising or falling) to which hysteresis is to be applied. hysteresis control prevents the comparator output from continuously changing state because of small perturbations (noise) at the input (see figure 20-2 ). figure 20-2: hyst eresis control 20.7 analog comparator resources many useful resources are provided on the main product page of the microchip web site for the devices listed in this data sheet. this product page contains the latest updates and additional information. 20.7.1 key resources ?high-speed analog comparator module? (ds70005128) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools output input hysteresis range (5 mv/10 mv/20 mv) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 233 dspic33epxxgs202 family register 20-1: cmpxcon: comparat or x control register (x = 1 , 2 ) r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 u-0 cmpon cmpsidl hyssel1 hyssel0 fltren fclksel bit 15 bit 8 r/w-0 r/w-0 u-0 r/w-0 hc/hs-0 r/w-0 r/w-0 u-0 insel1 insel0 hyspol cmpstat altinp cmppol bit 7 bit 0 legend: hc = hardware clearable bit hs = hardware settable bit r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 cmpon: comparator operating mode bit 1 = comparator module is enabled 0 = comparator module is disabled (reduces power consumption) bit 14 unimplemented: read as 0 bit 13 cmpsidl: comparator stop in idle mode bit 1 = discontinues module operation when device enters idle mode. 0 = continues module operation in idle mode if a device has multiple comparators, any cmpsidl bit set to 1 disables all comparators while in idle mode. bit 12-11 hyssel<1:0>: comparator hysteresis select bits 11 = 20 mv hysteresis 10 = 10 mv hysteresis 01 = 5 mv hysteresis 00 = no hysteresis is selected bit 10 fltren: digital filter enable bit 1 = digital filter is enabled 0 = digital filter is disabled bit 9 fclksel: digital filter and pulse stretcher clock select bit 1 = digital filter and pulse stretcher operate with the pwm clock 0 = digital filter and pulse stretcher operate with the system clock bit 8 unimplemented: read as 0 bit 7-6 insel<1:0>: input source select for comparator bits if altinp = 0 , select from comparator inputs: 11 = selects cmpxd input pin 10 = selects cmpxc input pin 01 = selects cmpxb input pin 00 = selects cmpxa input pin if altinp = 1 , select from alternate inputs: 11 = reserved 10 = reserved 01 = selects pga2 output 00 = selects pga1 output bit 5 unimplemented: read as 0 bit 4 hyspol: comparator hysteresis polarity select bit 1 = hysteresis is applied to the falling edge of the comparator output 0 = hysteresis is applied to the rising edge of the comparator output bit 3 cmpstat: current state of comparator output including cmppol selection bit downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 234 ? 2015-2016 microchip technology inc. bit 2 altinp: alternate input select bit 1 = insel<1:0> bits select alternate inputs 0 = insel<1:0> bits select comparator inputs bit 1 cmppol: comparator output polarity control bit 1 = output is inverted 0 = output is non-inverted bit 0 unimplemented: read as 0 register 20-1: cmpxcon: comparat or x control register (x = 1 , 2 ) (continued) register 20-2: cmpxdac: comparator dacx control register (x = 1 , 2 ) u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 c m r e f < 1 1 : 8 > bit 15 bit 8 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 cmref<7:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-12 unimplemented: read as 0 bit 11-0 cmref<11:0>: comparator reference voltage select bits 111111111111 = (cmref<11:0> * (av dd )/4096) 000000000000 = 0.0 volts downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 235 dspic33epxxgs202 family 21.0 programmable gain amplifier (pga) the dspic33epxxgs202 family devices have two programmable gain amplifiers (pga1, pga2). the pga is an op amp-based, non-inverting amplifier with user-programmable gains. the output of the pga can be connected to a number of dedicated sample-and- hold inputs of the analog-to-digital converter and/or to the high-speed analog comparator module. the pga has five selectable gains and may be used as a ground referenced amplifier (single-ended) or used with an independent ground reference point. key features of the pga module include: single-ended or independent ground reference selectable gains: 4x, 8x, 16x, 32x and 64x high gain bandwidth rail-to-rail output voltage wide input voltage range figure 21-1: pgax mo dule block diagram note 1: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to ?programmable gain amplifier (pga)? (ds70005146) in the ?dspic33/pic24 family reference man- ual? , which is available from the microchip web site ( www.microchip.com ). 2: some registers and associated bits described in this section may not be available on all devices. refer to section 4.0 ?memory organization? in this data sheet for device-specific register and bit information. gain<2:0> = 6 gain of 64 gain<2:0> = 5 gain<2:0> = 4 gain<2:0> = 3 gain<2:0> = 2 ampx C+ pgax calibrations<5:0> bits pgax negative input pgax positive input gain of 32 gain of 16 gain of 8 gain of 4 pgaxout note 1: x = 1 and 2. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 236 ? 2015-2016 microchip technology inc. 21.1 module description the programmable gain amplifiers are used to amplify small voltages (e.g., voltages across burden/shunt resistors) to improve the signal-to-noise ratio of the measured signal. the pgax output voltage can be read by the two dedicated sample-and-hold circuits on the adc module. the output voltage can also be fed to the comparator module for overcurrent/voltage protec- tion. figure 21-2 shows a functional block diagram of the pgax module. refer to section 19.0 ?high- speed, 12-bit analog-to-digital converter (adc)? and section 20.0 ?high-speed analog comparator? for more interconnection details. the gain of the pgax module is selectable via the gain<2:0> bits in the pgaxcon register. there are five selectable gains, ranging from 4x to 64x. the selpi<2:0> and selni<2:0> bits in the pgaxcon register select one of three positive/negative inputs to the pgax module. for single-ended applications, the selni<2:0> bits will select ground as the negative input source. to provide an independent ground reference, the pgaxn2 pin is available as the negative input source to the pgax module. figure 21-2: pgax f unctional block diagram C + pgaxp1 (1) pgaxp2 (1) pgaxp3 (1) selpi<2:0> selni<2:0> gnd pgaxn2 (1) gnd adc s&h pgaxcon (1) pgaxcal (1) pgaen gain<2:0> pgacal<5:0> pgax (1) note 1: x = 1, 2. +C insel<1:0> (cmpxcon) dacx cxchs<1:0> (adcon4h) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 237 dspic33epxxgs202 family 21.2 pga resources many useful resources are provided on the main product page of the microchip website for the devices listed in this data sheet. this product page contains the latest updates and additional information. 21.2.1 key resources ?programmable gain amplifier (pga)? (ds70005146) in the ?dspic33/pic24 family reference manual? code samples application notes software libraries webinars all related ?dspic33/pic24 family reference manual? sections development tools register 21-1: pgaxcon: pgax control register (x = 1 , 2 ) r/w-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pgaen selpi2 selpi1 selpi0 selni2 selni1 selni0 bit 15 bit 8 u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 gain2 gain1 gain0 bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15 pgaen: pgax enable bit 1 = pgax module is enabled 0 = pgax module is disabled (reduces power consumption) bit 14 unimplemented: read as 0 bit 13-11 selpi<2:0>: pgax positive input selection bits 111 = reserved 110 = reserved 101 = reserved 100 = reserved 011 = reserved 010 = pgaxp3 001 = pgaxp2 000 = pgaxp1 bit 10-8 selni<2:0>: pgax negative input selection bits 111 = reserved 110 = reserved 101 = reserved 100 = reserved 011 = ground (single-ended mode) 010 = reserved 001 = pgaxn2 000 = ground (single-ended mode) bit 7-3 unimplemented: read as 0 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 238 ? 2015-2016 microchip technology inc. bit 2-0 gain<2:0>: pgax gain selection bits 111 = reserved 110 = gain of 64 101 = gain of 32 100 = gain of 16 011 = gain of 8 010 = gain of 4 001 = reserved 000 = reserved register 21-1: pgaxcon: pgax control register (x = 1 , 2 ) (continued) register 21-2: pgaxcal: pgax calibration register (x = 1 , 2 ) u-0 u-0 u-0 u-0 u-0 u-0 u-0 u-0 bit 15 bit 8 u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 pgacal<5:0> bit 7 bit 0 legend: r = readable bit w = writable bit u = unimplemented bit, read as 0 -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown bit 15-6 unimplemented: read as 0 bit 5-0 pgacal<5:0>: pgax offset calibration bits the calibration values for pga1 and pga2 must be copied from flash addresses, 0x800e48 and 0x800e4c, respectively, into these bits before the module is enabled. refer to the device calibration addresses table ( tab l e 2 2- 3 ) in section 22.0 ?special features? for more information. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 239 dspic33epxxgs202 family 22.0 special features the dspic33epxxgs202 family devices include several features intended to maximize application flexibility and reliability, and minimize cost through elimination of external components. these are: flexible configuration watchdog timer (wdt) code protection and codeguard? security jtag boundary scan interface in-circuit serial programming? (icsp?) in-circuit emulation brown-out reset (bor) 22.1 configuration bits in the dspic33epxxgs202 family devices, the configuration words are implemented as volatile memory. this means that configuration data must be programmed each time the device is powered up. configuration data is stored at the end of the on-chip program memory space, known as the flash configu- ration words. their specific locations are shown in table 22-1 with detailed descriptions in table 22-2 . the configuration data is automatically loaded from the flash configuration words to the proper configuration shadow registers during device resets. when creating applications for these devices, users should always specifically allocate the location of the flash configuration words for configuration data in their code for the compiler. this is to make certain that program code is not stored in this address when the code is compiled. program code executing out of configuration space will cause a device reset. note: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). note: configuration data is reloaded on all types of device resets. note: performing a page erase operation on the last page of program memory clears the flash configuration words. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 240 ? 2015-2016 microchip technology inc. table 22-1: configuration register map name address device memory size (kbytes) bits 23-16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 fsec 002b80 16 a i v t d i s css <2:0> cwrp gss <1:0> gwrp bsen bss <1:0> bwrp 005780 32 fbslim 002b90 16 bslim <12:0> 005790 32 fsign 002b94 16 reserved ( 2 ) 005794 32 foscsel 002b98 16 ieso fnosc<2:0> 005798 32 fosc 002b9c 16 pllken fcksm<1:0> iol1way osciofnc poscmd<1:0> 00579c 32 fwdt 002ba0 16 wdtwin<1:0> windis wdten<1:0> wdtpre wdtpost <3:0> 0057a0 32 fpor 002ba4 16 reserved ( 1 ) 0057a4 32 ficd 002ba8 16 r es e rv ed ( 1 ) jt agen ics <1:0> 0057a8 32 fdevopt 002bac 16 reserved ( 1 ) pwmlock 0057ac 32 faltreg 002bb0 16 ctxt2 <2:0> ctxt1 <2:0> 0057b0 32 note 1: these bits are reserved and must be programmed as 1 . 2: this bit is reserved and must be programmed as 0 . downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 241 dspic33epxxgs202 family table 22-2: configuration bits description bit field description bss<1:0> boot segment code-protect level bits 11 = boot segment is not code-protected other than bwrp 10 = standard security 0x = high security bsen boot segment control bit 1 = no boot segment is enabled 0 = boot segment size is determined by the bslim<12:0> bits bwrp boot segment write-protect bit 1 = boot segment can be written 0 = boot segment is write-protected bslim<12:0> boot segment flash page address limit bits contains the last active boot segment page. the value to be programmed is the inverted page address, such that programming additional 0 s can only increase the boot segment size (i.e., 0x1ffd = 2 pages or 1024 iw). gss<1:0> general segment code-protect level bits 11 = user program memory is not code-protected 10 = standard security 0x = high security gwrp general segment write-protect bit 1 = user program memory is not write-protected 0 = user program memory is write-protected cwrp configuration segment write-protect bit 1 = configuration data is not write-protected 0 = configuration data is write protected css<2:0> configuration segment code-protect level bits 111 = configuration data is not code-protected 110 = standard security 10x = enhanced security 0xx = high security aivtdis ( 1 ) alternate interrupt vector table bit 1 = alternate interrupt vector table is disabled 0 = alternate interrupt vector table is enabled if intcon2<8> = 1 ieso two-speed oscillator start-up enable bit 1 = starts up device with frc, then automatically switches to the user-selected oscillator source when ready 0 = starts up device with the user-selected oscillator source pwmlock pwm lock enable bit 1 = certain pwm registers may only be written after a key sequence 0 = pwm registers may be written without a key sequence note 1: the boot segment must be present to use the alternate interrupt vector table. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 242 ? 2015-2016 microchip technology inc. fnosc<2:0> oscillator selection bits 111 = fast rc oscillator with divide-by-n (frcdivn) 110 = fast rc oscillator with divide-by-16 101 = low-power rc oscillator (lprc) 100 = reserved; do not use 011 = primary oscillator with pll module (xtpll, hspll, ecpll) 010 = primary oscillator (xt, hs, ec) 001 = fast rc oscillator with divide-by-n with pll module (frcpll) 000 = fast rc oscillator (frc) fcksm<1:0> clock switching mode bits 1x = clock switching is disabled, fail-safe clock monitor is disabled 01 = clock switching is enabled, fail-safe clock monitor is disabled 00 = clock switching is enabled, fail-safe clock monitor is enabled iol1way peripheral pin select configuration bit 1 = allows only one reconfiguration 0 = allows multiple reconfigurations osciofnc osc2 pin function bit (except in xt and hs modes) 1 = osc2 is the clock output 0 = osc2 is a general purpose digital i/o pin poscmd<1:0> primary oscillator mode select bits 11 = primary oscillator is disabled 10 = hs crystal oscillator mode 01 = xt crystal oscillator mode 00 = ec (external clock) mode wdten<1:0> watchdog timer enable bits 11 = watchdog timer is always enabled (lprc oscillator cannot be disabled; clearing the swdten bit in the rcon register will have no effect) 10 = watchdog timer is enabled/disabled by user software (lprc can be disabled by clearing the swdten bit in the rcon register) 01 = watchdog timer is enabled only while device is active and is disabled while in sleep mode; software control is disabled in this mode 00 = watchdog timer and the swdten bit are disabled windis watchdog timer window enable bit 1 = watchdog timer is in non-window mode 0 = watchdog timer is in window mode pllken pll lock enable bit 1 = pll lock is enabled 0 = pll lock is disabled wdtpre watchdog timer prescaler bit 1 = 1:128 0 = 1:32 wdtpost<3:0> watchdog timer postscaler bits 1111 = 1:32,768 1110 = 1:16,384 0001 = 1:2 0000 = 1:1 table 22-2: configuration bits description (continued) bit field description note 1: the boot segment must be present to use the alternate interrupt vector table. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 243 dspic33epxxgs202 family wdtwin<1:0> watchdog timer window select bits 11 = wdt window is 25% of the wdt period 10 = wdt window is 37.5% of the wdt period 01 = wdt window is 50% of the wdt period 00 = wdt window is 75% of the wdt period jtagen jtag enable bit 1 = jtag is enabled 0 = jtag is disabled ics<1:0> icd communication channel select bits 11 = communicates on pgec1 and pged1 10 = communicates on pgec2 and pged2 01 = communicates on pgec3 and pged3 00 = reserved, do not use ctxt1<2:0> specifies interrupt priority level (ipl) associated to alternate working register 1 bits 111 = reserved 110 = assigned to ipl of 7 101 = assigned to ipl of 6 100 = assigned to ipl of 5 011 = assigned to ipl of 4 010 = assigned to ipl of 3 001 = assigned to ipl of 2 000 = assigned to ipl of 1 ctxt2<2:0> specifies interrupt priority level (ipl) associated to alternate working register 2 bits 111 = reserved 110 = assigned to ipl of 7 101 = assigned to ipl of 6 100 = assigned to ipl of 5 011 = assigned to ipl of 4 010 = assigned to ipl of 3 001 = assigned to ipl of 2 000 = assigned to ipl of 1 table 22-2: configuration bits description (continued) bit field description note 1: the boot segment must be present to use the alternate interrupt vector table. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 244 ? 2015-2016 microchip technology inc. 22.2 device calibration and identification the pgax modules on the dspic33epxxgs202 family devices require calibration data registers to improve performance of the module over a wide operating range. these calibration registers are read-only and are stored in configuration memory space. prior to enabling the module, the calibration data must be read (tblpag and table read instruction) and loaded into their respective sfr registers. the device calibration addresses are shown in table 22-3 . the dspic33epxxgs202 devices have two identifica- tion registers near the end of configuration memory space that store the device id (devid) and device revision (devrev). these registers are used to determine the mask, variant and manufacturing infor- mation about the device. these registers are read-only and are shown in register 22-1 and register 22-2 . table 22-3: device calibration addresses ( 1 ) calibration name address bits 23-16 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bi t 1 bit 0 pga1cal 800e48 pga1 calibration data bits pga2cal 800e4c pga2 calibration data bits note 1: the calibration data must be copied into its respective registers pri or to enabling the module. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 245 dspic33epxxgs202 family register 22-1: devid: device id register rrrrrrrr devid<23:16> bit 23 bit 16 rrrrrrrr devid<15:8> bit 15 bit 8 rrrrrrrr devid<7:0> bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devid<23:0>: device identifier bits register 22-2: devrev: device revision register rrrrrrrr devrev<23:16> bit 23 bit 16 rrrrrrrr devrev<15:8> bit 15 bit 8 rrrrrrrr devrev<7:0> bit 7 bit 0 legend: r = read-only bit u = unimplemented bit bit 23-0 devrev<23:0>: device revision bits downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 246 ? 2015-2016 microchip technology inc. 22.3 one-time-programmable (otp) memory area dspic33epxxgs202 family devices contain thirty-two otp areas, located at addresses, 0x800f80 through 0x800ffc. the otp area can be used for storing product information, such as serial numbers, system manufacturing dates, manufacturing lot numbers and other application-specific information. 22.4 on-chip voltage regulator all the dspic33epxxgs202 family devices power their core digital logic at a nominal 1.8v. this can create a conflict for designs that are required to operate at a higher typical voltage, such as 3.3v. to simplify system design, all devices in the dspic33epxxgs202 family incorporate an on-chip regulator that allows the device to run its core logic from v dd . the regulator provides power to the core from the other v dd pins. a low-esr (less than 1 ohm) capacitor (such as tantalum or ceramic) must be connected to the v cap pin ( figure 22-1 ). this helps to maintain the stability of the regulator. the recommended value for the filter capacitor is provided in table 25-5 , located in section 25.0 ?electrical characteristics? . figure 22-1: conne ctions for the on-chip voltage regulator ( 1 , 2 , 3 ) 22.5 brown-out reset (bor) the brown-out reset (bor) module is based on an internal voltage reference circuit that monitors the reg- ulated supply voltage, v cap . the main purpose of the bor module is to generate a device reset when a brown-out condition occurs. brown-out conditions are generally caused by glitches on the ac mains (for example, missing portions of the ac cycle waveform due to bad power transmission lines or voltage sags due to excessive current draw when a large inductive load is turned on). a bor generates a reset pulse, which resets the device. the bor selects the clock source, based on the device configuration bit values (fnosc<2:0> and poscmd<1:0>). if an oscillator mode is selected, the bor activates the oscillator start-up timer (ost). the system clock is held until ost expires. if the pll is used, the clock is held until the lock bit (osccon<5>) is 1 . concurrently, the pwrt time-out (t pwrt ) is applied before the internal reset is released. if t pwrt = 0 and a crystal oscillator is being used, then a nominal delay of t fscm is applied. the total delay in this case is t fscm . refer to parameter sy35 in table 25-23 of section 25.0 ?electrical characteristics? for specific t fscm values. the bor status bit (rcon<1>) is set to indicate that a bor has occurred. the bor circuit continues to operate while in sleep or idle modes and resets the device should v dd fall below the bor threshold voltage. note: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. note 1: these are typical operating voltages. refer to table 25-5 located in section 25.0 ?electrical characteristics? for the full operating ranges of v dd and v cap . 2: it is important for the low-esr capacitor to be placed as close as possible to the v cap pin. 3: typical v cap pin voltage = 1.8v when v dd v ddmin . v dd v cap v ss dspic33ep 3.3v c efc downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 247 dspic33epxxgs202 family 22.6 watchdog timer (wdt) for dspic33epxxgs202 family devices, the wdt is driven by the lprc oscillator. when the wdt is enabled, the clock source is also enabled. 22.6.1 prescaler/postscaler the nominal wdt clock source from lprc is 32 khz. this feeds a prescaler that can be configured for either 5-bit (divide-by-32) or 7-bit (divide-by-128) operation. the prescaler is set by the wdtpre configuration bit. with a 32 khz input, the prescaler yields a wdt time- out period (t wdt ), as shown in parameter sy12 in table 25-23 . a variable postscaler divides down the wdt prescaler output and allows for a wide range of time-out periods. the postscaler is controlled by the wdtpost<3:0> configuration bits (fwdt<3:0>), which allow the selection of 16 settings, from 1:1 to 1:32,768. using the prescaler and postscaler, time-out periods, ranges from 1 ms to 131 seconds can be achieved. the wdt, prescaler and postscaler are reset: on any device reset on the completion of a clock switch, whether invoked by software (i.e., setting the oswen bit after changing the noscx bits) or by hardware (i.e., fail-safe clock monitor) when a pwrsav instruction is executed (i.e., sleep or idle mode is entered) when the device exits sleep or idle mode to resume normal operation by a clrwdt instruction during normal execution 22.6.2 sleep and idle modes if the wdt is enabled, it continues to run during sleep or idle modes. when the wdt time-out occurs, the device wakes and code execution continues from where the pwrsav instruction was executed. the corresponding sleep or idle bit (rcon<3:2>) needs to be cleared in software after the device wakes up. 22.6.3 enabling wdt the wdt is enabled or disabled by the wdten<1:0> configuration bits in the fwdt configuration register. when the wdten<1:0> configuration bits have been programmed to 0b11 , the wdt is always enabled. the wdt can be optionally controlled in software when the wdten<1:0> configuration bits have been programmed to 0b10 . the wdt is enabled in soft- ware by setting the swdten control bit (rcon<5>). the swdten control bit is cleared on any device reset. the software wdt option allows the user appli- cation to enable the wdt for critical code segments and disables the wdt during non-critical segments for maximum power savings. the wdt time-out flag bit, wdto (rcon<4>), is not automatically cleared following a wdt time-out. to detect subsequent wdt events, the flag must be cleared in software. 22.6.4 wdt window the watchdog timer has an optional windowed mode, enabled by programming the windis bit in the wdt configuration register (fwdt<7>). in the windowed mode (windis = 0 ), the wdt should be cleared based on the settings in the programmable watchdog timer window select bits (wdtwin<1:0>). figure 22-2: wdt block diagram note: the clrwdt and pwrsav instructions clear the prescaler and postscaler counts when executed. 0 1 wdtpre wdtpost<3:0> watchdog timer prescaler (divide-by-n1) postscaler (divide-by-n2) sleep/idle wdt wdt window select windis wdt clrwdt instruction swdten wdten<1:0> lprc clock rs rs wake-up reset wdtwin<1:0> all device resets transition to new clock source exit sleep or idle mode pwrsav instruction clrwdt instruction downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 248 ? 2015-2016 microchip technology inc. 22.7 jtag interface the dspic33epxxgs202 family devices implement a jtag interface, which supports boundary scan device testing. detailed information on this interface is provided in future revisions of the document. 22.8 in-circuit serial programming the dspic33epxxgs202 family devices can be serially programmed while in the end application circuit. this is done with two lines for clock and data, and three other lines for power, ground and the programming sequence. serial programming allows customers to manufacture boards with unprogrammed devices and then program the device just before shipping the product. serial programming also allows the most recent firmware or a custom firmware to be programmed. refer to the ?dspic33e/pic24e flash pr ogramming specification for devices with volatile configuration bits? (ds70663) for details about in-circuit serial programming (icsp). any of the three pairs of programming clock/data pins can be used: pgec1 and pged1 pgec2 and pged2 pgec3 and pged3 22.9 in-circuit debugger when mplab ? icd 3 or real ice? is selected as a debugger, the in-circuit debugging functionality is enabled. this function allows simple debugging functions when used with mplab x ide. debugging functionality is controlled through the pgecx (emulation/debug clock) and pgedx (emulation/debug data) pin functions. any of the three pairs of debugging clock/data pins can be used: pgec1 and pged1 pgec2 and pged2 pgec3 and pged3 to use the in-circuit debugger function of the device, the design must implement icsp connections to mclr , v dd , v ss and the pgecx/pgedx pin pair. in addition, when the feature is enabled, some of the resources are not available for general use. these resources include the first 80 bytes of data ram and two i/o pins (pgecx and pgedx). 22.10 code protection and codeguard? security dspic33epxxgs202 devices offer multiple levels of security for protecting individual intellectual property. the program flash protection can be broken up into three segments: boot segment (bs), general segment (gs) and configuration segment (cs). boot segment has the highest security privilege and can be thought to have limited restrictions when accessing other segments. general segment has the least security and is intended for the end user system code. configuration segment contains only the device user configuration data which is located at the end of the program memory space. the code protection features are controlled by the configuration registers, fsec and fbslim. the fsec register controls the code-protect level for each segment and if that segment is write-protected. the size of the bs and gs will depend on the bslim<12:0> setting and if the alternate interrupt vector table (aivt) is enabled. the bslim<12:0> bits define the number of pages for bs with each page containing 512 iw. the smallest bs size is one page, which will consist of the interrupt vector table (ivt) and 256 iw of code protection. if the aivt is enabled, the last page of bs will contain the aivt and will not contain any bs code. with aivt enabled, the smallest bs size is now two pages (1024 iw), with one page for the ivt and bs code, and the other page for the aivt. write protection of the boot segment does not cover the aivt. the last page of the bs can always be programmed or erased by bs code. the general segment will start at the next page and will consume the rest of program flash except for the flash configuration words. the ivt will assume gs security only if bs is not enabled. the ivt is protected from being programmed or page erased when either security segment has enabled write protection. note: refer to ?programming and diagnostics? (ds70608) in the ?dspic33/pic24 family reference manual? for further information on usage, configuration and operation of the jtag interface. note: refer to ?codeguard? intermediate security? (ds70005182) in the ?dspic33/ pic24 family reference manual? for further information on usage, configuration and operation of codeguard security. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 249 dspic33epxxgs202 family the different device security segments are shown in figure 22-3 . here, all three segments are shown but are not required. if only basic code protection is required, then the gs can be enabled independently or combined with the cs if desired. figure 22-3: dspic33epxxgs202 security segments example ivt and aivt assume ivt bs aivt + 256 iw (2) gs 0x000000 0x000200 bslim<12:0> 0xxxxxxx (3) cs (1) note 1: if cs is write-protected, the last page (gs + cs) of program memory will be protected from an erase condition. 2: the last half (256 iw) of the last page of the bs is unusable program memory. 3: DSPIC33EP16GS202 cs is 0x002bfe. dspic33ep32gs202 cs is 0x0057fe . bs protection downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 250 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 251 dspic33epxxgs202 family 23.0 instruction set summary the dspic33ep instruction set is almost identical to that of the dspic30f and dspic33f. most instructions are a single program memory word (24 bits). only three instructions require two program memory locations. each single-word instruction is a 24-bit word, divided into an 8-bit opcode, which specifies the instruction type and one or more operands, which further specify the operation of the instruction. the instruction set is highly orthogonal and is grouped into five basic categories: word or byte-oriented operations bit-oriented operations literal operations dsp operations control operations table 23-1 lists the general symbols used in describing the instructions. the dspic33ep instruction set summary in tab l e 2 3- 2 lists all the instructions, along with the status flags affected by each instruction. most word or byte-oriented w register instructions (including barrel shift instructions) have three operands: the first source operand, which is typically a register wb without any address modifier the second source operand, which is typically a register ws with or without an address modifier the destination of the result, which is typically a register wd with or without an address modifier however, word or byte-oriented file register instructions have two operands: the file register specified by the value f the destination, which could be either the file register f or the w0 register, which is denoted as wreg most bit-oriented instructions (including simple rotate/ shift instructions) have two operands: the w register (with or without an address modifier) or file register (specified by the value of ws or f) the bit in the w register or file register (specified by a literal value or indirectly by the contents of register wb) the literal instructions that involve data movement can use some of the following operands: a literal value to be loaded into a w register or file register (specified by k) the w register or file register where the literal value is to be loaded (specified by wb or f) however, literal instructions that involve arithmetic or logical operations use some of the following operands: the first source operand, which is a register wb without any address modifier the second source operand, which is a literal value the destination of the result (only if not the same as the first source operand), which is typically a register wd with or without an address modifier the mac class of dsp instructions can use some of the following operands: the accumulator (a or b) to be used (required operand) the w registers to be used as the two operands the x and y address space prefetch operations the x and y address space prefetch destinations the accumulator write back destination the other dsp instructions do not involve any multiplication and can include: the accumulator to be used (required) the source or destination operand (designated as wso or wdo, respectively) with or without an address modifier the amount of shift specified by a w register wn or a literal value the control instructions can use some of the following operands: a program memory address the mode of the table read and table write instructions note: this data sheet summarizes the features of the dspic33epxxgs202 family of devices. it is not intended to be a comprehensive reference source. to complement the information in this data sheet, refer to the related section in the ?dspic33/pic24 family reference manual? , which is available from the microchip web site ( www.microchip.com ). downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 252 ? 2015-2016 microchip technology inc. most instructions are a single word. certain double-word instructions are designed to provide all the required information in these 48 bits. in the second word, the 8msbs are 0 s. if this second word is executed as an instruction (by itself), it executes as a nop . the double-word instructions execute in two instruction cycles. most single-word instructions are executed in a single instruction cycle, unless a conditional test is true or the program counter is changed as a result of the instruc- tion, or a psv or table read is performed. in these cases, the execution takes multiple instruction cycles, with the additional instruction cycle(s) executed as a nop . certain instructions that involve skipping over the subse- quent instruction require either two or three cycles if the skip is performed, depending on whether the instruction being skipped is a single-word or two-word instruction. moreover, double-word moves require two cycles. note: for more details on the instruction set, refer to the ?16-bit mcu and dsc programmer?s reference manual? (ds70157). table 23-1: symbols used in opcode descriptions field description #text means literal defined by text (text) means content of text [text] means the location addressed by text { } optional field or operation a ? {b, c, d} a is selected from the set of values b, c, d register bit field .b byte mode selection .d double-word mode selection .s shadow register select .w word mode selection (default) acc one of two accumulators {a, b} awb accumulator write-back destination address register ?? {w13, [w13]+ = 2} bit4 4-bit bit selection field (used in word addressed instructions) ?? {0...15} c, dc, n, ov, z mcu status bits: carry, digit carry, negative, overflow, sticky zero expr absolute address, label or expression (resolved by the linker) f file register address ?? {0x0000...0x1fff} lit1 1-bit unsigned literal ?? {0,1} lit4 4-bit unsigned literal ?? {0...15} lit5 5-bit unsigned literal ?? {0...31} lit8 8-bit unsigned literal ?? {0...255} lit10 10-bit unsigned literal ?? {0...255} for byte mode, {0:1023} for word mode lit14 14-bit unsigned literal ?? {0...16384} lit16 16-bit unsigned literal ?? {0...65535} lit23 23-bit unsigned literal ?? {0...8388608}; lsb must be 0 none field does not require an entry, can be blank oa, ob, sa, sb dsp status bits: acca overflow, accb overflow, acca satu rate, accb saturate pc program counter slit10 10-bit signed literal ?? {-512...511} slit16 16-bit signed literal ?? {-32768...32767} slit6 6-bit signed literal ?? {-16...16} wb base w register ?? {w0...w15} wd destination w register ?? { wd, [wd], [wd++], [wd--], [++wd], [--wd] } wdo destination w register ?? { wnd, [wnd], [wnd++], [wnd--], [++wnd], [--wnd], [wnd+wb] } wm,wn dividend, divisor working register pair (direct addressing) downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 253 dspic33epxxgs202 family wm*wm multiplicand and multiplier working r egister pair for square instructions ?? {w4 * w4,w5 * w5,w6 * w6,w7 * w7} wm*wn multiplicand and multiplier working r egister pair for dsp instructions ? {w4 * w5,w4 * w6,w4 * w7,w5 * w6,w5 * w7,w6 * w7} wn one of 16 working registers ?? {w0...w15} wnd one of 16 destination working registers ?? {w0...w15} wns one of 16 source working registers ?? {w0...w15} wreg w0 (working register used in file register instructions) ws source w register ?? { ws, [ws], [ws++], [ws--], [++ws], [--ws] } wso source w register ?? { wns, [wns], [wns++], [wns--], [++wns], [--wns], [wns+wb] } wx x data space prefetch address register for dsp instructions ? {[w8] + = 6, [w8] + = 4, [w8] + = 2, [w8], [w8] - = 6, [w8] - = 4, [w8] - = 2, [w9] + = 6, [w9] + = 4, [w9] + = 2, [w9], [w9] - = 6, [w9] - = 4, [w9] - = 2, [w9 + w12], none} wxd x data space prefetch destination register for dsp instructions ?? {w4...w7} wy y data space prefetch address register for dsp instructions ? {[w10] + = 6, [w10] + = 4, [w10] + = 2, [w10], [w10] - = 6, [w10] - = 4, [w10] - = 2, [w11] + = 6, [w11] + = 4, [w11] + = 2, [w11], [w11] - = 6, [w11] - = 4, [w1 1] - = 2, [w11 + w12], none} wyd y data space prefetch destination register for dsp instructions ?? {w4...w7} table 23-1: symbols used in opcode descriptions (continued) field description downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 254 ? 2015-2016 microchip technology inc. table 23-2: instruction set overview base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected 1 add add acc add accumulators 1 1 oa,ob,sa,sb add f f = f + wreg 1 1 c,dc,n,ov,z add f,wreg wreg = f + wreg 1 1 c,dc,n,ov,z add #lit10,wn wd = lit10 + wd 1 1 c,dc,n,ov,z add wb,ws,wd wd = wb + ws 1 1 c,dc,n,ov,z add wb,#lit5,wd wd = wb + lit5 1 1 c,dc,n,ov,z add wso,#slit4,acc 16-bit signed add to accumulator 1 1 oa,ob,sa,sb 2 addc addc f f = f + wreg + (c) 1 1 c,dc,n,ov,z addc f,wreg wreg = f + wreg + (c) 1 1 c,dc,n,ov,z addc #lit10,wn wd = lit10 + wd + (c) 1 1 c,dc,n,ov,z addc wb,ws,wd wd = wb + ws + (c) 1 1 c,dc,n,ov,z addc wb,#lit5,wd wd = wb + lit5 + (c) 1 1 c,dc,n,ov,z 3 and and f f = f .and. wreg 1 1 n,z and f,wreg wreg = f .and. wreg 1 1 n,z and #lit10,wn wd = lit10 .and. wd 1 1 n,z and wb,ws,wd wd = wb .and. ws 1 1 n,z and wb,#lit5,wd wd = wb .and. lit5 1 1 n,z 4 asr asr f f = arithmetic right shift f 1 1 c,n,ov,z asr f,wreg wreg = arithmetic right shift f 1 1 c,n,ov,z asr ws,wd wd = arithmetic right shift ws 1 1 c,n,ov,z asr wb,wns,wnd wnd = arithmetic right shift wb by wns 1 1 n,z asr wb,#lit5,wnd wnd = arithmetic right shift wb by lit5 1 1 n,z 5 bclr bclr f,#bit4 bit clear f 1 1 none bclr ws,#bit4 bit clear ws 1 1 none 7 bra bra c,expr branch if carry 1 1 (4) none bra ge,expr branch if greater than or equal 1 1 (4) none bra geu,expr branch if unsigned greater than or equal 1 1 (4) none bra gt,expr branch if greater than 1 1 (4) none bra gtu,expr branch if unsigned greater than 1 1 (4) none bra le,expr branch if less than or equal 1 1 (4) none bra leu,expr branch if unsigned less than or equal 1 1 (4) none bra lt,expr branch if less than 1 1 (4) none bra ltu,expr branch if unsigned less than 1 1 (4) none bra n,expr branch if negative 1 1 (4) none bra nc,expr branch if not carry 1 1 (4) none bra nn,expr branch if not negative 1 1 (4) none bra nov,expr branch if not overflow 1 1 (4) none bra nz,expr branch if not zero 1 1 (4) none bra oa,expr branch if accumulator a overflow 1 1 (4) none bra ob,expr branch if accumulator b overflow 1 1 (4) none bra ov,expr branch if overflow 1 1 (4) none bra sa,expr branch if accumulator a saturated 1 1 (4) none bra sb,expr branch if accumulator b saturated 1 1 (4) none bra expr branch unconditionally 1 4 none bra z,expr branch if zero 1 1 (4) none bra wn computed branch 1 4 none 8 bset bset f,#bit4 bit set f 1 1 none bset ws,#bit4 bit set ws 1 1 none note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 255 dspic33epxxgs202 family 9 bsw bsw.c ws,wb write c bit to ws 1 1 none bsw.z ws,wb write z bit to ws 1 1 none 10 btg btg f,#bit4 bit toggle f 1 1 none btg ws,#bit4 bit toggle ws 1 1 none 11 btsc btsc f,#bit4 bit test f, skip if clear 1 1 (2 or 3) none btsc ws,#bit4 bit test ws, skip if clear 1 1 (2 or 3) none 12 btss btss f,#bit4 bit test f, skip if set 1 1 (2 or 3) none btss ws,#bit4 bit test ws, skip if set 1 1 (2 or 3) none 13 btst btst f,#bit4 bit test f 1 1 z btst.c ws,#bit4 bit test ws to c 1 1 c btst.z ws,#bit4 bit test ws to z 1 1 z btst.c ws,wb bit test ws to c 1 1 c btst.z ws,wb bit test ws to z 1 1 z 14 btsts btsts f,#bit4 bit test then set f 1 1 z btsts.c ws,#bit4 bit test ws to c, then set 1 1 c btsts.z ws,#bit4 bit test ws to z, then set 1 1 z 15 call call lit23 call subroutine 2 4 sfa call wn call indirect subroutine 1 4 sfa call.l wn call indirect subroutine (long address) 1 4 sfa 16 clr clr f f = 0x0000 1 1 none clr wreg wreg = 0x0000 1 1 none clr ws ws = 0x0000 1 1 none clr acc,wx,wxd,wy,wyd,awb clear accumulator 1 1 oa,ob,sa,sb 17 clrwdt clrwdt clear watchdog timer 1 1 wdto,sleep 18 com com f f = f 11 n , z com f,wreg wreg = f 11 n , z com ws,wd wd = ws 11 n , z 19 cp cp f compare f with wreg 1 1 c,dc,n,ov,z cp wb,#lit8 compare wb with lit8 1 1 c,dc,n,ov,z cp wb,ws compare wb with ws (wb C ws) 1 1 c,dc,n,ov,z 20 cp0 cp0 f compare f with 0x0000 1 1 c,dc,n,ov,z cp0 ws compare ws with 0x0000 1 1 c,dc,n,ov,z 21 cpb cpb f compare f with wreg, with borrow 1 1 c,dc,n,ov,z cpb wb,#lit8 compare wb with lit8, with borrow 1 1 c,dc,n,ov,z cpb wb,ws compare wb with ws, with borrow (wb C ws C c ) 1 1 c,dc,n,ov,z 22 cpseq cpseq wb,wn compare wb with wn, skip if = 1 1 (2 or 3) none cpbeq cpbeq wb,wn,expr compare wb with wn, branch if = 1 1 (5) none 23 cpsgt cpsgt wb,wn compare wb with wn, skip if > 1 1 (2 or 3) none cpbgt cpbgt wb,wn,expr compare wb with wn, branch if > 1 1 (5) none 24 cpslt cpslt wb,wn compare wb with wn, skip if < 1 1 (2 or 3) none cpblt cpblt wb,wn,expr compare wb with wn, branch if < 1 1 (5) none 25 cpsne cpsne wb,wn compare wb with wn, skip if ? 11 (2 or 3) none cpbne cpbne wb,wn,expr compare wb with wn, branch if ? 11 ( 5 ) n o n e table 23-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 256 ? 2015-2016 microchip technology inc. 26 ctxtswp ctxtswp #1it3 switch cpu register context to context defined by lit3 12 n o n e ctxtswp wn switch cpu register context to context defined by wn 12 n o n e 27 daw daw wn wn = decimal adjust wn 1 1 c 28 dec dec f f = f C 1 1 1 c,dc,n,ov,z dec f,wreg wreg = f C 1 1 1 c,dc,n,ov,z dec ws,wd wd = ws C 1 1 1 c,dc,n,ov,z 29 dec2 dec2 f f = f C 2 1 1 c,dc,n,ov,z dec2 f,wreg wreg = f C 2 1 1 c,dc,n,ov,z dec2 ws,wd wd = ws C 2 1 1 c,dc,n,ov,z 30 disi disi #lit14 disable interrupts for k instruction cycles 1 1 none 31 div div.s wm,wn signed 16/16-bit integer divide 1 18 n,z,c,ov div.sd wm,wn signed 32/16-bit integer divide 1 18 n,z,c,ov div.u wm,wn unsigned 16/16-bit integer divide 1 18 n,z,c,ov div.ud wm,wn unsigned 32/16-bit integer divide 1 18 n,z,c,ov 32 divf divf wm,wn signed 16/16-bit fractional divide 1 18 n,z,c,ov 33 do do #lit15,expr do code to pc + expr, lit15 + 1 times 2 2 none do wn,expr do code to pc + expr, (wn) + 1 times 2 2 none 34 ed ed wm*wm,acc,wx,wy,wxd euclidean distance (no accumulate) 1 1 oa,ob,oab, sa,sb,sab 35 edac edac wm*wm,acc,wx,wy,wxd euclidean distance 1 1 oa,ob,oab, sa,sb,sab 36 exch exch wns,wnd swap wns with wnd 1 1 none 37 fbcl fbcl ws,wnd find bit change from left (msb) side 1 1 c 38 ff1l ff1l ws,wnd find first one from left (msb) side 1 1 c 39 ff1r ff1r ws,wnd find first one from right (lsb) side 1 1 c 40 goto goto expr go to address 2 4 none goto wn go to indirect 1 4 none goto.l wn go to indirect (long address) 1 4 none 41 inc inc f f = f + 1 1 1 c,dc,n,ov,z inc f,wreg wreg = f + 1 1 1 c,dc,n,ov,z inc ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 42 inc2 inc2 f f = f + 2 1 1 c,dc,n,ov,z inc2 f,wreg wreg = f + 2 1 1 c,dc,n,ov,z inc2 ws,wd wd = ws + 2 1 1 c,dc,n,ov,z 43 ior ior f f = f .ior. wreg 1 1 n,z ior f,wreg wreg = f .ior. wreg 1 1 n,z ior #lit10,wn wd = lit10 .ior. wd 1 1 n,z ior wb,ws,wd wd = wb .ior. ws 1 1 n,z ior wb,#lit5,wd wd = wb .ior. lit5 1 1 n,z 44 lac lac wso,#slit4,acc load accumulator 1 1 oa,ob,oab, sa,sb,sab 45 lnk lnk #lit14 link frame pointer 1 1 sfa 46 lsr lsr f f = logical right shift f 1 1 c,n,ov,z lsr f,wreg wreg = logical right shift f 1 1 c,n,ov,z lsr ws,wd wd = logical right shift ws 1 1 c,n,ov,z lsr wb,wns,wnd wnd = logical right shift wb by wns 1 1 n,z lsr wb,#lit5,wnd wnd = logical right shift wb by lit5 1 1 n,z table 23-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 257 dspic33epxxgs202 family 47 mac mac wm*wn,acc,wx,wxd,wy,wyd,awb multiply and accumulate 1 1 oa,ob,oab, sa,sb,sab mac wm*wm,acc,wx,wxd,wy,wyd square and accumulate 1 1 oa,ob,oab, sa,sb,sab 48 mov mov f,wn move f to wn 1 1 none mov f move f to f 1 1 none mov f,wreg move f to wreg 1 1 none mov #lit16,wn move 16-bit literal to wn 1 1 none mov.b #lit8,wn move 8-bit literal to wn 1 1 none mov wn,f move wn to f 1 1 none mov wso,wdo move ws to wd 1 1 none mov wreg,f move wreg to f 1 1 none mov.d wns,wd move double from w(ns):w(ns + 1) to wd 1 2 none mov.d ws,wnd move double from ws to w(nd + 1):w(nd) 12 n o n e 49 movpag movpag #lit10,dsrpag move 10-bit literal to dsrpag 1 1 none movpag #lit8,tblpag move 8-bit literal to tblpag 1 1 none movpagw ws, dsrpag move ws<9:0> to dsrpag 1 1 none movpagw ws, tblpag move ws<7:0> to tblpag 1 1 none 50 movsac movsac acc,wx,wxd,wy,wyd,awb prefetch and store accumulator 1 1 none 51 mpy mpy wm*wn,acc,wx,wxd,wy,wyd multiply wm by wn to accumulator 1 1 oa,ob,oab, sa,sb,sab mpy wm*wm,acc,wx,wxd,wy,wyd square wm to accumulator 1 1 oa,ob,oab, sa,sb,sab 52 mpy.n mpy.n wm*wn,acc,wx,wxd,wy,wyd -(multiply wm by wn) to accumulator 1 1 none 53 msc msc wm*wm,acc,wx,wxd,wy,wyd,awb multiply and subtract from accumulator 1 1 oa,ob,oab, sa,sb,sab 54 mul mul.ss wb,ws,wnd {wnd + 1, wnd} = signed(wb) * signed(ws) 1 1 none mul.ss wb,ws,acc accumulator = signed(wb) * signed(ws) 1 1 none mul.su wb,ws,wnd {wnd + 1, wnd} = signed(wb) * unsigned(ws) 11 n o n e mul.su wb,ws,acc accumulator = signed(wb) * unsigned(ws) 1 1 none mul.su wb,#lit5,acc accumulator = signed(wb) * unsigned(lit5) 1 1 none mul.us wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * signed(ws) 11 n o n e mul.us wb,ws,acc accumulator = unsigned(wb) * signed(ws) 1 1 none mul.uu wb,ws,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(ws) 11 n o n e mul.uu wb,#lit5,acc accumulator = unsigned(wb) * unsigned(lit5) 11 n o n e mul.uu wb,ws,acc accumulator = unsigned(wb) * unsigned(ws) 11 n o n e mulw.ss wb,ws,wnd wnd = signed(wb) * signed(ws) 1 1 none mulw.su wb,ws,wnd wnd = signed(wb) * unsigned(ws) 1 1 none mulw.us wb,ws,wnd wnd = unsigned(wb) * signed(ws) 1 1 none mulw.uu wb,ws,wnd wnd = unsigned(wb) * unsigned(ws) 1 1 none mul.su wb,#lit5,wnd {wnd + 1, wnd} = signed(wb) * unsigned(lit5) 11 n o n e mul.su wb,#lit5,wnd wnd = signed(wb) * unsigned(lit5) 1 1 none mul.uu wb,#lit5,wnd {wnd + 1, wnd} = unsigned(wb) * unsigned(lit5) 11 n o n e mul.uu wb,#lit5,wnd wnd = unsigned(wb) * unsigned(lit5) 1 1 none mul f w3:w2 = f * wreg 1 1 none table 23-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 258 ? 2015-2016 microchip technology inc. 55 neg neg acc negate accumulator 1 1 oa,ob,oab, sa,sb,sab neg f f = f + 1 1 1 c,dc,n,ov,z neg f,wreg wreg = f + 1 1 1 c,dc,n,ov,z neg ws,wd wd = ws + 1 1 1 c,dc,n,ov,z 56 nop nop no operation 1 1 none nopr no operation 1 1 none 57 pop pop f pop f from top-of-stack (tos) 1 1 none pop wdo pop from top-of-stack (tos) to wdo 1 1 none pop.d wnd pop from top-of-stack (tos) to w(nd):w(nd + 1) 12 n o n e pop.s pop shadow registers 1 1 all 58 push push f push f to top-of-stack (tos) 1 1 none push wso push wso to top-of-stack (tos) 1 1 none push.d wns push w(ns):w(ns + 1) to top-of-stack (tos) 12 n o n e push.s push shadow registers 1 1 none 59 pwrsav pwrsav #lit1 go into sleep or idle mode 1 1 wdto,sleep 60 rcall rcall expr relative call 1 4 sfa rcall wn computed call 1 4 sfa 61 repeat repeat #lit15 repeat next instruction lit15 + 1 times 1 1 none repeat wn repeat next instruction (wn) + 1 times 1 1 none 62 reset reset software device reset 1 1 none 63 retfie retfie return from interrupt 1 6 (5) sfa 64 retlw retlw #lit10,wn return with literal in wn 1 6 (5) sfa 65 return return return from subroutine 1 6 (5) sfa 66 rlc rlc f f = rotate left through carry f 1 1 c,n,z rlc f,wreg wreg = rotate left through carry f 1 1 c,n,z rlc ws,wd wd = rotate left through carry ws 1 1 c,n,z 67 rlnc rlnc f f = rotate left (no carry) f 1 1 n,z rlnc f,wreg wreg = rotate left (no carry) f 1 1 n,z rlnc ws,wd wd = rotate left (no carry) ws 1 1 n,z 68 rrc rrc f f = rotate right through carry f 1 1 c,n,z rrc f,wreg wreg = rotate right through carry f 1 1 c,n,z rrc ws,wd wd = rotate right through carry ws 1 1 c,n,z 69 rrnc rrnc f f = rotate right (no carry) f 1 1 n,z rrnc f,wreg wreg = rotate right (no carry) f 1 1 n,z rrnc ws,wd wd = rotate right (no carry) ws 1 1 n,z 70 sac sac acc,#slit4,wdo store accumulator 1 1 none sac.r acc,#slit4,wdo store rounded accumulator 1 1 none 71 se se ws,wnd wnd = sign-extended ws 1 1 c,n,z 72 setm setm f f = 0xffff 1 1 none setm wreg wreg = 0xffff 1 1 none setm ws ws = 0xffff 1 1 none 73 sftac sftac acc,wn arithmetic shift accumulator by (wn) 1 1 oa,ob,oab, sa,sb,sab sftac acc,#slit6 arithmetic shift accumulator by slit6 1 1 oa,ob,oab, sa,sb,sab table 23-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 259 dspic33epxxgs202 family 74 sl sl f f = left shift f 1 1 c,n,ov,z sl f,wreg wreg = left shift f 1 1 c,n,ov,z sl ws,wd wd = left shift ws 1 1 c,n,ov,z sl wb,wns,wnd wnd = left shift wb by wns 1 1 n,z sl wb,#lit5,wnd wnd = left shift wb by lit5 1 1 n,z 75 sub sub acc subtract accumulators 1 1 oa,ob,oab, sa,sb,sab sub f f = f C wreg 1 1 c,dc,n,ov,z sub f,wreg wreg = f C wreg 1 1 c,dc,n,ov,z sub #lit10,wn wn = wn C lit10 1 1 c,dc,n,ov,z sub wb,ws,wd wd = wb C ws 1 1 c,dc,n,ov,z sub wb,#lit5,wd wd = wb C lit5 1 1 c,dc,n,ov,z 76 subb subb f f = f C wreg C (c ) 1 1 c,dc,n,ov,z subb f,wreg wreg = f C wreg C (c ) 1 1 c,dc,n,ov,z subb #lit10,wn wn = wn C lit10 C (c ) 1 1 c,dc,n,ov,z subb wb,ws,wd wd = wb C ws C (c ) 1 1 c,dc,n,ov,z subb wb,#lit5,wd wd = wb C lit5 C (c ) 1 1 c,dc,n,ov,z 77 subr subr f f = wreg C f 1 1 c,dc,n,ov,z subr f,wreg wreg = wreg C f 1 1 c,dc,n,ov,z subr wb,ws,wd wd = ws C wb 1 1 c,dc,n,ov,z subr wb,#lit5,wd wd = lit5 C wb 1 1 c,dc,n,ov,z 78 subbr subbr f f = wreg C f C (c ) 1 1 c,dc,n,ov,z subbr f,wreg wreg = wreg C f C (c ) 1 1 c,dc,n,ov,z subbr wb,ws,wd wd = ws C wb C (c ) 1 1 c,dc,n,ov,z subbr wb,#lit5,wd wd = lit5 C wb C (c ) 1 1 c,dc,n,ov,z 79 swap swap.b wn wn = nibble swap wn 1 1 none swap wn wn = byte swap wn 1 1 none 80 tblrdh tblrdh ws,wd read prog<23:16> to wd<7:0> 1 5 none 81 tblrdl tblrdl ws,wd read prog<15:0> to wd 1 5 none 82 tblwth tblwth ws,wd write ws<7:0> to prog<23:16> 1 2 none 83 tblwtl tblwtl ws,wd write ws to prog<15:0> 1 2 none 84 ulnk ulnk unlink frame pointer 1 1 sfa 85 xor xor f f = f .xor. wreg 1 1 n,z xor f,wreg wreg = f .xor. wreg 1 1 n,z xor #lit10,wn wd = lit10 .xor. wd 1 1 n,z xor wb,ws,wd wd = wb .xor. ws 1 1 n,z xor wb,#lit5,wd wd = wb .xor. lit5 1 1 n,z 86 ze ze ws,wnd wnd = zero-extend ws 1 1 c,z,n table 23-2: instruction set overview (continued) base instr # assembly mnemonic assembly syntax description # of words # of cycles status flags affected note: read and read-modify-write (e.g., bit operations and logical operation s) on non-cpu sfrs incur an additional instruction cycle. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 260 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 261 dspic33epxxgs202 family 24.0 development support the pic ? microcontrollers (mcu) and dspic ? digital signal controllers (dsc) are supported with a full range of software and hardware development tools: integrated development environment - mplab ? x ide software compilers/assemblers/linkers - mplab xc compiler - mpasm tm assembler -mplink tm object linker/ mplib tm object librarian - mplab assembler/linker/librarian for various device families simulators - mplab x sim software simulator emulators - mplab real ice? in-circuit emulator in-circuit debuggers/programmers - mplab icd 3 - pickit? 3 device programmers - mplab pm3 device programmer low-cost demonstration/development boards, evaluation kits and starter kits third-party development tools 24.1 mplab x integrated development environment software the mplab x ide is a single, unified graphical user interface for microchip and third-party software, and hardware development tool that runs on windows ? , linux and mac os ? x. based on the netbeans ide, mplab x ide is an entirely new ide with a host of free software components and plug-ins for high- performance application development and debugging. moving between tools and upgrading from software simulators to hardware debugging and programming tools is simple with the seamless user interface. with complete project management, visual call graphs, a configurable watch window and a feature-rich editor that includes code completion and context menus, mplab x ide is flexible and friendly enough for new users. with the ability to support multiple tools on multiple projects with simultaneous debugging, mplab x ide is also suitable for the needs of experienced users. feature-rich editor: color syntax highlighting smart code completion makes suggestions and provides hints as you type automatic code formatting based on user-defined rules live parsing user-friendly, customizable interface: fully customizable interface: toolbars, toolbar buttons, windows, window placement, etc. call graph window project-based workspaces: multiple projects multiple tools multiple configurations simultaneous debugging sessions file history and bug tracking: local file history feature built-in support for bugzilla issue tracker downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 262 ? 2015-2016 microchip technology inc. 24.2 mplab xc compilers the mplab xc compilers are complete ansi c compilers for all of microchips 8, 16 and 32-bit mcu and dsc devices. these compilers provide powerful integration capabilities, superior code optimization and ease of use. mplab xc compilers run on windows, linux or mac os x. for easy source level debugging, the compilers provide debug information that is optimized to the mplab x ide. the free mplab xc compiler editions support all devices and commands, with no time or memory restrictions, and offer sufficient code optimization for most applications. mplab xc compilers include an assembler, linker and utilities. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. mplab xc compiler uses the assembler to produce its object file. notable features of the assembler include: support for the entire device instruction set support for fixed-point and floating-point data command-line interface rich directive set flexible macro language mplab x ide compatibility 24.3 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for pic10/12/16/18 mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol reference, absolute lst files that contain source lines and generated machine code, and coff files for debugging. the mpasm assembler features include: integration into mplab x ide projects user-defined macros to streamline assembly code conditional assembly for multipurpose source files directives that allow complete control over the assembly process 24.4 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler. it can link relocatable objects from precompiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of precompiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/library features include: efficient linking of single libraries instead of many smaller files enhanced code maintainability by grouping related modules together flexible creation of libraries with easy module listing, replacement, deletion and extraction 24.5 mplab assembler, linker and librarian for various device families mplab assembler produces relocatable machine code from symbolic assembly language for pic24, pic32 and dspic dsc devices. mplab xc compiler uses the assembler to produce its object file. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. notable features of the assembler include: support for the entire device instruction set support for fixed-point and floating-point data command-line interface rich directive set flexible macro language mplab x ide compatibility downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 263 dspic33epxxgs202 family 24.6 mplab x sim software simulator the mplab x sim software simulator allows code development in a pc-hosted environment by simulating the pic mcus and dspic dscs on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a comprehensive stimulus controller. registers can be logged to files for further run-time analysis. the trace buffer and logic analyzer display extend the power of the simulator to record and track program execution, actions on i/o, most peripherals and internal registers. the mplab x sim software simulator fully supports symbolic debugging using the mplab xc compilers, and the mpasm and mplab assemblers. the software simulator offers the flexibility to develop and debug code outside of the hardware laboratory environment, making it an excellent, economical software development tool. 24.7 mplab real ice in-circuit emulator system the mplab real ice in-circuit emulator system is microchips next generation high-speed emulator for microchip flash dsc and mcu devices. it debugs and programs all 8, 16 and 32-bit mcu, and dsc devices with the easy-to-use, powerful graphical user interface of the mplab x ide. the emulator is connected to the design engineers pc using a high-speed usb 2.0 interface and is connected to the target with either a connector compatible with in-circuit debugger systems (rj-11) or with the new high-speed, noise tolerant, low- voltage differential signal (lvds) interconnection (cat5). the emulator is field upgradable through future firmware downloads in mplab x ide. mplab real ice offers significant advantages over competitive emulators including full-speed emulation, run-time variable watches, trace analysis, complex breakpoints, logic probes, a ruggedized probe interface and long (up to three meters) interconnection cables. 24.8 mplab icd 3 in-circuit debugger system the mplab icd 3 in-circuit debugger system is microchips most cost-effective, high-speed hardware debugger/programmer for microchip flash dsc and mcu devices. it debugs and programs pic flash microcontrollers and dspic dscs with the powerful, yet easy-to-use graphical user interface of the mplab ide. the mplab icd 3 in-circuit debugger probe is connected to the design engineers pc using a high- speed usb 2.0 interface and is connected to the target with a connector compatible with the mplab icd 2 or mplab real ice systems (rj-11). mplab icd 3 supports all mplab icd 2 headers. 24.9 pickit 3 in-circuit debugger/ programmer the mplab pickit 3 allows debugging and programming of pic and dspic flash microcontrollers at a most affordable price point using the powerful graphical user interface of the mplab ide. the mplab pickit 3 is connected to the design engineers pc using a full-speed usb interface and can be connected to the target via a microchip debug (rj-11) connector (compatible with mplab icd 3 and mplab real ice). the connector uses two device i/o pins and the reset line to implement in-circuit debugging and in-circuit serial programming? (icsp?). 24.10 mplab pm3 device programmer the mplab pm3 device programmer is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features a large lcd display (128 x 64) for menus and error messages, and a modular, detachable socket assembly to support various package types. the icsp cable assembly is included as a standard item. in stand-alone mode, the mplab pm3 device programmer can read, verify and program pic devices without a pc connection. it can also set code protection in this mode. the mplab pm3 connects to the host pc via an rs-232 or usb cable. the mplab pm3 has high-speed communications and optimized algorithms for quick programming of large memory devices, and incorporates an mmc card for file storage and data applications. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 264 ? 2015-2016 microchip technology inc. 24.11 demonstration/development boards, evaluation kits and starter kits a wide variety of demonstration, development and evaluation boards for various pic mcus and dspic dscs allows quick application development on fully functional systems. most boards include prototyping areas for adding custom circuitry and provide application firmware and source code for examination and modification. the boards support a variety of features, including leds, temperature sensors, switches, speakers, rs-232 interfaces, lcd displays, potentiometers and additional eeprom memory. the demonstration and development boards can be used in teaching environments, for prototyping custom circuits and for learning about various microcontroller applications. in addition to the picdem? and dspicdem? demonstration/development board series of circuits, microchip has a line of evaluation kits and demonstration software for analog filter design, k ee l oq ? security ics, can, irda ? , powersmart battery management, seeval ? evaluation system, sigma-delta adc, flow rate sensing, plus many more. also available are starter kits that contain everything needed to experience the specified device. this usually includes a single application and debug capability, all on one board. check the microchip web page ( www.microchip.com ) for the complete list of demonstration, development and evaluation kits. 24.12 third-party development tools microchip also offers a great collection of tools from third-party vendors. these tools are carefully selected to offer good value and unique functionality. device programmers and gang programmers from companies, such as softlog and ccs software tools from companies, such as gimpel and trace systems protocol analyzers from companies, such as saleae and total phase demonstration boards from companies, such as mikroelektronika, digilent ? and olimex embedded ethernet solutions from companies, such as ez web lynx, wiznet and iplogika ? downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 265 dspic33epxxgs202 family 25.0 electrical characteristics this section provides an overview of the dspic33epxxgs202 family electrical characteristics. additional information will be provided in future revisions of this document as it becomes available. absolute maximum ratings for the dspic33epxxgs202 family are listed below. exposure to these m aximum rating conditions for extended periods may affect device reliability. functional operation of the device at these, or any other conditions above the parameters indicated in the operation listings of this specification, is not implied. absolute maximum ratings ( 1 ) ambient temperature under bias................................................................................................. ............-40c to +125c storage temperature ............................................................................................................ .................. -65c to +150c voltage on v dd with respect to v ss .......................................................................................................... -0.3v to +4.0v voltage on any pin that is not 5v tolerant with respect to v ss ( 3 ) ..................................................... -0.3v to (v dd + 0.3v) voltage on any 5v tolerant pin with respect to v ss when v dd ? 3.0v ( 3 ) ................................................... -0.3v to +5.5v voltage on any 5v tolerant pin with respect to v ss when v dd < 3.0v ( 3 ) ................................................... -0.3v to +3.6v maximum current out of v ss pin ........................................................................................................................... 300 ma maximum current into v dd pin ( 2 ) ...........................................................................................................................300 ma maximum current sunk/sourced by any 4x i/o pin................................................................................. .................15 ma maximum current sunk/sourced by any 8x i/o pin ................................................................................. .................25 ma maximum current sunk by all ports ( 2 ) ....................................................................................................................200 ma note 1: stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device at those, or any other conditions above those indicated in the operation listings of this specification, is not implied. exposure to maximum rating conditions for extended periods may affect device reliability. 2: maximum allowable current is a function of device maximum power dissipation (see tab l e 2 5- 2 ). 3: see the ? pin diagrams ? section for the 5v tolerant pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 266 ? 2015-2016 microchip technology inc. 25.1 dc characteristics table 25-1: operating mips vs. voltage characteristic v dd range (in volts) temperature range (in c) maximum mips dspic33epxxgs202 family 3.0v to 3.6v ( 1 ) -40c to +85c 70 3.0v to 3.6v ( 1 ) -40c to +125c 60 note 1: device is functional at v bormin < v dd < v ddmin . analog modules (adc, pgas and comparators) may have degraded performance. device functionality is tested but not characterized. refer to parameter bo10 in table 25-13 for the minimum and maximum bor values. table 25-2: thermal operating conditions rating symbol min. typ. max. unit industrial temperature devices operating junction temperature range t j -40 +125 c operating ambient temperature range t a -40 +85 c extended temperature devices operating junction temperature range t j -40 +140 c operating ambient temperature range t a -40 +125 c power dissipation: internal chip power dissipation: p int = v dd x (i dd ? ? i oh ) p d p int + p i / o w i/o pin power dissipation: i/o = ? ({v dd ? v oh } x i oh ) + ? (v ol x i ol ) maximum allowed power dissipation p dmax (t j C t a )/ ? ja w table 25-3: thermal packaging characteristics characteristic symbol typ. max. unit notes package thermal resistance, 28-pin qfn-s ? ja 30.0 c/w 1 package thermal resistance, 28-pin uqfn ? ja 26.0 c/w 1 package thermal resistance, 28-pin soic ? ja 69.7 c/w 1 package thermal resistance, 28-pin ssop ? ja 71.0 c/w 1 note 1: junction to ambient thermal resistance, theta- ja ( ? ja ) numbers are achieved by package simulations. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 267 dspic33epxxgs202 family table 25-5: filter capacitor (c efc ) specifications table 25-4: dc temperature and voltage specifications dc characteristics standard operating conditions: 3.0v to 3.6v ( 1 ) (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units conditions operating voltage dc10 v dd supply voltage 3.0 3.6 v dc12 v dr ram data retention voltage ( 2 ) 1.8 v dc16 v por v dd start voltage to ensure internal power-on reset signal v ss v dc17 sv dd v dd rise rate to ensure internal power-on reset signal 1.0 v/ms 0v-3v in 3 ms note 1: device is functional at v bormin < v dd < v ddmin . analog modules (adc, pgas and comparators) may have degraded performance. device functionality is tested but not characterized. refer to parameter bo10 in table 25-13 for the minimum and maximum bor values. 2: this is the limit to which v dd may be lowered without losing ram data. standard operating conditions (unless otherwise stated): operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics min. typ. max. units comments c efc external filter capacitor value ( 1 ) 4.7 10 ? f capacitor must have a low series resistance (<1 ohm) note 1: typical v cap voltage = 1.8v when v dd ? v ddmin . downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 268 ? 2015-2016 microchip technology inc. table 25-6: dc characteristics: operating current (i dd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions operating current (i dd ) ( 1 ) dc20d 5 10 ma -40c 3.3v 10 mips dc20a 5 10 ma +25c dc20b 5 10 ma +85c dc20c 5 10 ma +125c dc22d 10 15 ma -40c 3.3v 20 mips dc22a 10 15 ma +25c dc22b 10 15 ma +85c dc22c 10 15 ma +125c dc24d 15 20 ma -40c 3.3v 40 mips dc24a 15 20 ma +25c dc24b 15 20 ma +85c dc24c 15 20 ma +125c dc25d 20 28 ma -40c 3.3v 60 mips dc25a 20 28 ma +25c dc25b 20 28 ma +85c dc25c 20 28 ma +125c dc26d 30 35 ma -40c 3.3v 70 mips dc26a 30 35 ma +25c dc26b 30 35 ma +85c note 1: i dd is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test conditions for all i dd measurements are as follows: oscillator is configured in ec mode with pll, osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) clko is configured as an i/o input pin in the configuration word all i/o pins are configured as outputs and driving low mclr = v dd , wdt and fscm are disabled cpu, sram, program memory and data memory are operational no peripheral modules are operating or being clocked (defined pmdx bits are all ones) cpu executing: while(1) { nop(); } jtag is disabled downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 269 dspic33epxxgs202 family table 25-7: dc characteristics: idle current (i idle ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions idle current (i idle ) ( 1 ) dc40d 1 3 ma -40c 3.3v 10 mips dc40a 1 3 ma +25c dc40b 1 3 ma +85c dc40c 1 3 ma +125c dc42d 3 5 ma -40c 3.3v 20 mips dc42a 3 5 ma +25c dc42b 3 5 ma +85c dc42c 3 5 ma +125c dc44d 5 7 ma -40c 3.3v 40 mips dc44a 5 7 ma +25c 7 dc44b 5 ma +85c 7 dc44c 5 ma +125c dc45d 7 9 ma -40c 3.3v 60 mips dc45a 7 9 ma +25c 9 dc45b 7 ma +85c 9 dc45c 7 ma +125c dc46d 9 12 ma -40c 3.3v 70 mips dc46a 9 12 ma +25c dc46b 9 12 ma +85c note 1: base idle current (i idle ) is measured as follows: cpu core is off, oscillator is configured in ec mode and external clock is active; osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) clko is configured as an i/o input pin in the configuration word all i/o pins are configured as outputs and driving low mclr = v dd , wdt and fscm are disabled no peripheral modules are operating or being clocked (defined pmdx bits are all ones) the nvmsidl bit (nvmcon<12>) = 1 (i.e., flash regulator is set to standby while the device is in idle mode) the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to standby while the device is in sleep mode) jtag is disabled downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 270 ? 2015-2016 microchip technology inc. table 25-8: dc characteristics: power-down current (i pd ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions power-down current (i pd ) ( 1 ) dc60d 10 30 ? a -40c 3.3v dc60a 16 60 ? a+ 2 5 c dc60b 60 300 ? a+ 8 5 c dc60c 300 800 ? a +125c note 1: i pd (sleep) current is measured as follows: cpu core is off, oscillator is configured in ec mode and external clock is active; osc1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) clko is configured as an i/o input pin in the configuration word all i/o pins are configured as output and driving low. m clr = v dd , wdt and fscm are disabled all peripheral modules are disabled (pmdx bits are all set) the vregs bit (rcon<8>) = 0 (i.e., core regulator is set to standby while the device is in sleep mode) the vregsf bit (rcon<11>) = 0 (i.e., flash regulator is set to standby while the device is in sleep mode) jtag is disabled table 25-9: dc characteristics: watchdog timer delta current ( ? i wdt ) ( 1 ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. units conditions dc61d 1 2 ? a- 4 0 c 3.3v dc61a 1 2 ? a +25c dc61b 1 3 ? a +85c dc61c 2 5 ? a +125c note 1: the ? i wdt current is the additional current consumed when the module is enabled. this current should be added to the base i pd current. all parameters are characterized but not tested during manufacturing. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 271 dspic33epxxgs202 family table 25-10: dc characteristics: doze current (i doze ) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended parameter no. typ. max. doze ratio units conditions doze current (i doze ) ( 1 ) dc73a ( 2 ) 15 20 1:2 ma -40c 3.3v f osc = 140 mhz dc73g 7 9 1:128 ma dc70a ( 2 ) 15 20 1:2 ma +25c 3.3v f osc = 140 mhz dc70g 7 9 1:128 ma dc71a ( 2 ) 15 20 1:2 ma +85c 3.3v f osc = 140 mhz dc71g 7 9 1:128 ma dc72a ( 2 ) 15 20 1:2 ma +125c 3.3v f osc = 120 mhz dc72g 7 9 1:128 ma note 1: i doze is primarily a function of the operating voltage and frequency. other factors, such as i/o pin loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current consumption. the test conditions for all i doze measurements are as follows: oscillator is configured in ec mode and external clock is active, osc 1 is driven with external square wave from rail-to-rail (ec clock overshoot/undershoot < 250 mv required) clko is configured as an i/o input pin in the configuration word all i/o pins are configured as outputs and driving low mclr = v dd , wdt and fscm are disabled cpu, sram, program memory and data memory are operational no peripheral modules are operating or being clocked (defined pmdx bits are all ones) cpu executing: while(1) { nop(); } jtag is disabled 2: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 272 ? 2015-2016 microchip technology inc. table 25-11: dc characteristics: i/o pin input specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions v il input low voltage di10 any i/o pin and mclr v ss 0 . 2 v dd v di18 i/o pins with sda1, scl1 v ss 0.3 v dd v smbus disabled di19 i/o pins with sda1, scl1 v ss 0.8 v smbus enabled v ih input high voltage di20 i/o pins not 5v tolerant ( 4 ) 0.8 v dd v dd v i/o pins 5v tolerant and mclr ( 4 ) 0.8 v dd 5 . 5v 5v tolerant i/o pins with sda1, scl1 ( 4 ) 0.8 v dd 5.5 v smbus disabled 5v i/o pins with sda1, scl1 ( 4 ) 2.1 5.5 v smbus enabled i/o pins with sda1, scl1 not 5v tolerant ( 4 ) 0.8 v dd v dd v smbus disabled i/o pins with sda1, scl1 not 5v tolerant ( 4 ) 2.1 v dd v smbus enabled di30 i cnpu input change notification pull-up current 50 250 600 ? av dd = 3.3v, v pin = v ss di31 i cnpd input change notification pull-down current ( 5 ) 5 0 ? av dd = 3.3v, v pin = v dd note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 5: v il source < (v ss C 0.3). characterized but not tested. 6: v ih source > (v dd + 0.3) for non-5v tolerant pins only. 7: digital 5v tolerant pins do not have an internal high side diode to v dd , and therefore, cannot tolerate any positive input injection current. 8: |injection currents| > 0 can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted, provided the mathematical absolute instantaneous sum of the input injection curr ents from all pins do not exceed the specified limit. characterized but not tested. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 273 dspic33epxxgs202 family i il input leakage current ( 2 , 3 ) di50 i/o pins 5v tolerant ( 4 ) -1 +1 ? av ss ? v pin ? v dd , pin at high-impedance di51 i/o pins not 5v tolerant ( 4 ) -1 +1 ? av ss ? v pin ? v dd , pin at high-impedance, -40c ? t a ? +85c di51a i/o pins not 5v tolerant ( 4 ) -1 +1 ? a analog pins shared with external reference pins, -40c ? t a ? +85c di51b i/o pins not 5v tolerant ( 4 ) -1 +1 ? av ss ? v pin ? v dd , pin at high-impedance, -40c ? t a ? +125c di51c i/o pins not 5v tolerant ( 4 ) -1 +1 ? a analog pins shared with external reference pins, -40c ? t a ? +125c di55 mclr -5 +5 ? av ss ?? v pin ?? v dd di56 osc1 -5 +5 ? av ss ?? v pin ?? v dd , xt and hs modes table 25-11: dc characteristics: i/o pin input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 5: v il source < (v ss C 0.3). characterized but not tested. 6: v ih source > (v dd + 0.3) for non-5v tolerant pins only. 7: digital 5v tolerant pins do not have an internal high side diode to v dd , and therefore, cannot tolerate any positive input injection current. 8: |injection currents| > 0 can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted, provided the mathematical absolute instantaneous sum of the input injection curre nts from all pins do not exceed the specified limit. characterized but not tested. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 274 ? 2015-2016 microchip technology inc. i icl input low injection current di60a 0 -5 ( 5 , 8 ) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap and rb7 i ich input high injection current di60b 0 +5 ( 6 , 7 , 8 ) ma all pins except v dd , v ss , av dd , av ss , mclr , v cap , rb7 and all 5v tolerant pins ( 7 ) ? i ict total input injection current di60c (sum of all i/o and control pins) -20 ( 7 ) + 2 0 ( 7 ) ma absolute instantaneous sum of all input injection currents from all i/o pins (| i icl | + | i ich |) ? ? i ict table 25-11: dc characteristics: i/o pin input specifications (continued) dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current can be measured at different input voltages. 3: negative current is defined as current sourced by the pin. 4: see the ? pin diagrams ? section for the 5v tolerant i/o pins. 5: v il source < (v ss C 0.3). characterized but not tested. 6: v ih source > (v dd + 0.3) for non-5v tolerant pins only. 7: digital 5v tolerant pins do not have an internal high side diode to v dd , and therefore, cannot tolerate any positive input injection current. 8: |injection currents| > 0 can affect the adc results by approximately 4-6 counts. 9: any number and/or combination of i/o pins not excluded under i icl or i ich conditions are permitted, provided the mathematical absolute instantaneous sum of the input injection curr ents from all pins do not exceed the specified limit. characterized but not tested. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 275 dspic33epxxgs202 family table 25-12: dc characteristics: i/o pin output specifications dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. symbol characteristic min. ( 1 ) typ. max. units conditions do10 v ol output low voltage 4x sink driver pins ( 2 ) 0 . 4vv dd = 3.3v, i ol ? 6 ma, -40c ? t a ? +85c, i ol ? 5 ma, +85c < t a ? +125c output low voltage 8x sink driver pins ( 3 ) 0 . 4vv dd = 3.3v, i ol ? 12 ma, -40c ? t a ? +85c, i ol ? 8 ma, +85c < t a ? +125c do20 v oh output high voltage 4x source driver pins ( 2 ) 2.4 v i oh ? -10 ma, v dd = 3.3v output high voltage 8x source driver pins ( 3 ) 2.4 v i oh ? -15 ma, v dd = 3.3v do20a v oh 1 output high voltage 4x source driver pins ( 2 ) 1.5 v i oh ? -14 ma, v dd = 3.3v 2.0 v i oh ? -12 ma, v dd = 3.3v 3.0 v i oh ? -7 ma, v dd = 3.3v output high voltage 8x source driver pins ( 3 ) 1.5 v i oh ? -22 ma, v dd = 3.3v 2.0 v i oh ? -18 ma, v dd = 3.3v 3.0 v i oh ? -10 ma, v dd = 3.3v note 1: parameters are for design guidance only and are not tested in manufacturing. 2: includes rb<14:11> pins. 3: includes all i/o pins that are not 4x driver pins (see note 2 ). table 25-13: electrical characteristics: bor dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 1 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. ( 2 ) typ. max. units conditions bo10 v bor bor event on v dd transition high-to-low 2.65 2.95 v v dd ( notes 2 , 3 ) note 1: device is functional at v bormin < v dd < v ddmin , but will have degraded performance. device functionality is tested, but not characterized. analog modules (adc, pgas and comparators) may have degraded performance. 2: parameters are for design guidance only and are not tested in manufacturing. 3: the v bor specification is relative to v dd . downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 276 ? 2015-2016 microchip technology inc. table 25-14: dc characteristics: program memory dc characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions program flash memory d130 e p cell endurance 10,000 e/w -40 ? c to +125 ? c d131 v pr v dd for read 3.0 3.6 v d132b v pew v dd for self-timed write 3.0 3.6 v d134 t retd characteristic retention 20 year provided no other specifications are violated, -40 ? c to +125 ? c d135 i ddp supply current during programming ( 2 ) 1 0 m a d136 i peak instantaneous peak current during start-up 1 5 0m a d137a t pe page erase time 19.7 20.1 ms t pe = 146893 frc cycles, t a = +85c ( note 3 ) d137b t pe page erase time 19.5 20.3 ms t pe = 146893 frc cycles, t a = +125c ( note 3 ) d138a t ww word write cycle time 46.5 47.3 s t ww = 346 frc cycles, t a = +85c ( note 3 ) d138b t ww word write cycle time 46.0 47.9 s t ww = 346 frc cycles, t a = +125c ( note 3 ) d139a t rw row write time 667 679 s t rw = 4965 frc cycles, t a = +85c ( note 3 ) d139b t rw row write time 660 687 s t rw = 4965 frc cycles, t a = +125c ( note 3 ) note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. 2: parameters are for design guidance only and are not tested in manufacturing. 3: other conditions: frc = 7.37 mhz, tun<5:0> = 011111 (for min.), tun<5:0> = 100000 (for max.). this parameter depends on the frc accuracy (see table 25-20 ) and the value of the frc oscillator tuning register (see register 8-4 ). for complete details on calculating the minimum and maximum time, see section 5.3 ?programming operations? . downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 277 dspic33epxxgs202 family 25.2 ac characteristics and timing parameters this section defines the dspic33epxxgs202 family ac characteristics and timing parameters. table 25-15: temperature and vo ltage specifications ? ac figure 25-1: load conditions for device timing specifications table 25-16: capacitiv e loading requirements on output pins ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended operating voltage v dd range as described in section 25.1 ?dc characteristics? . param no. symbol characteristic min. typ. max. units conditions do50 c osco osc2 pin 15 pf in xt and hs modes, when external clock is used to drive osc1 do56 c io all i/o pins and osc2 50 pf ec mode do58 c b scl1, sda1 400 pf in i 2 c mode v dd /2 c l r l pin pin v ss v ss c l r l =464 ? c l = 50 pf for all pins except osc2 15 pf for osc2 output load condition 1 C for all pins except osc2 load condition 2 C for osc2 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 278 ? 2015-2016 microchip technology inc. figure 25-2: external clock timing q1 q2 q3 q4 osc1 clko q1 q2 q3 q4 os20 os30 os30 os40 os41 os31 os25 os31 table 25-17: external clo ck timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symb characteristic min. typ. ( 1 ) max. units conditions os10 f in external clki frequency (external clocks allowed only in ec and ecpll modes) dc 60 mhz ec oscillator crystal frequency 3.5 10 1040 mhzmhz xths os20 t osc t osc = 1/f osc 8.33 dc ns +125c t osc = 1/f osc 7.14 dc ns +85c os25 t cy instruction cycle time ( 2 ) 16.67 dc ns +125c instruction cycle time ( 2 ) 14.28 dc ns +85c os30 tosl, to s h external clock in (osc1) high or low time 0.45 x t osc 0.55 x t osc ns ec os31 tosr, to s f external clock in (osc1) rise or fall time 20 ns ec os40 tckr clko rise time ( 3 , 4 ) 5 . 2n s os41 tckf clko fall time ( 3 , 4 ) 5 . 2n s os42 g m external oscillator transconductance ( 4 ) 12 ma/v hs, v dd = 3.3v, t a = +25c 6m a / v x t , v dd = 3.3v, t a = +25c note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. 2: instruction cycle period (t cy ) equals two times the input oscillator time base period. all specified values are based on characterization data for that particular oscillator type, under standard operating condition s, with the device executing code. exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. all devices are tested to operate at minimum values with an external clock applied to the osc1 pin. when an external clock input is used, the maximum cycle time limit is dc (no clock) for all devices. 3: measurements are taken in ec mode. the clko signal is measured on the osc2 pin. 4: parameters are for design guidance only and are not tested in manufacturing. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 279 dspic33epxxgs202 family table 25-18: pll clock ti ming specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions os50 f plli pll voltage controlled oscillator (vco) input frequency range 0.8 8.0 mhz ecpll, xtpll modes os51 f vco on-chip vco system frequency 120 340 mhz os52 t lock pll start-up time (lock time) 0.9 1.5 3.1 ms os53 d clk clko stability (jitter) ( 2 ) -3 0.5 3 % note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested in manufacturing. 2: this jitter specification is based on clock cycle-by-clock cycle measurements. to get the effectiv e jitter for individual time bases, or communication clocks used by the application, use the following formula: for example, if f osc = 120 mhz and the spi1 bit rate = 10 mhz, the effective jitter is as follows: effective jitter d clk f osc time base or communication clock -------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------------- = effective jitter d clk 120 10 -------- - ------------- - d clk 12 ------------- - d clk 3.464 ------------- - === table 25-19: auxiliary pll cl ock timing specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min typ. ( 1 ) max units conditions os56 f hpout on-chip 16x pll cco frequency 112 118 120 mhz os57 f hpin on-chip 16x pll phase detector input frequency 7.0 7.37 7.5 mhz os58 t su frequency generator lock time 1 0 s note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 280 ? 2015-2016 microchip technology inc. table 25-20: internal frc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. characteristic min. typ. max. units conditions internal frc accuracy @ frc frequency = 7.37 mhz ( 1 , 2 ) f20a frc -2 0.5 +2 % -40c ? t a ?? -10c v dd = 3.0-3.6v -0.9 0.5 +0.9 % -10c ? t a ?? +85c v dd = 3.0-3.6v f20b frc -2 1 +2 % +85c ? t a ? +125c v dd = 3.0-3.6v note 1: frequency is calibrated at +25c and 3.3v. tunx bits can be used to compensate for temperature drift. 2: over the lifetime of the 28-lead 4x4 uqfn package device, the internal frc accuracy could vary between 4%. table 25-21: internal lprc accuracy ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. characteristic min. typ. max. units conditions lprc @ 32.768 khz ( 1 ) f21a lprc -30 +30 % -40c ? t a ? -10c v dd = 3.0-3.6v -20 +20 % -10c ? t a ? +85c v dd = 3.0-3.6v f21b lprc -30 +30 % +85c ? t a ? +125c v dd = 3.0-3.6v note 1: this is the change of the lprc frequency as v dd changes. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 281 dspic33epxxgs202 family figure 25-3: i/o timing characteristics figure 25-4: bor and master clear re set timing characteristics note: refer to figure 25-1 for load conditions. i/o pin (input) i/o pin (output) di35 old value new value di40 do31 do32 table 25-22: i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. ( 1 ) max. units conditions do31 t io r port output rise time 5 10 ns do32 t io f port output fall time 5 10 ns di35 t inp intx pin high or low time (input) 20 ns di40 t rbp cnx high or low time (input) 2 t cy note 1: data in typ. column is at 3.3v, +25c unless otherwise stated. mclr (sy20) bor (sy30) t mclr t bor reset sequence cpu starts fetching code various delays (depending on configuration) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 282 ? 2015-2016 microchip technology inc. table 25-23: reset, watchdog timer, oscill ator start-up timer, power-up timer timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sy00 t pu power-up period 400 600 ? s sy10 t ost oscillator start-up time 1024 t osc t osc = osc1 period sy12 t wdt watchdog timer time-out period 0.81 1.22 ms wdtpre = 0 , wdtpost<3:0> = 0000 , using lprc tolerances indicated in f21a / f21b (see table 25-21 ) at +85c 3.25 4.88 ms wdtpre = 1 , wdtpost<3:0> = 0000 , using lprc tolerances indicated in f21a / f21b (see table 25-21 ) at +85c sy13 t ioz i/o high-impedance from mclr low or watchdog timer reset 0.68 0.72 1.2 ? s sy20 t mclr mclr pulse width (low) 2 ? s sy30 t bor bor pulse width (low) 1 ? s sy35 t fscm fail-safe clock monitor delay 500 900 ? s -40c to +85c sy36 t vreg voltage regulator standby-to-active mode transition time 3 0 ? s sy37 t oscdfrc frc oscillator start-up delay 2 9 ? s sy38 t oscdlprc lprc oscillator start-up delay 7 0 ? s note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 283 dspic33epxxgs202 family figure 25-5: timer1-timer3 external cl ock timing characteristics note: refer to figure 25-1 for load conditions. txck tmrx tx10 tx11 tx15 os60 tx20 table 25-24: timer1 external clock timing requirements ( 1 ) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 2 ) min. typ. max. units conditions ta10 t tx h t1ck high time synchronous mode greater of: 20 or (t cy + 20)/n ns must also meet parameter ta15, n = prescaler value (1, 8, 64, 256) asynchronous 35 ns ta11 t tx lt 1 c k l o w time synchronous mode greater of: 20 or (t cy + 20)/n ns must also meet parameter ta15, n = prescaler value (1, 8, 64, 256) asynchronous 10 ns ta15 t tx p t1ck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ns n = prescale value (1, 8, 64, 256) os60 ft1 t1ck oscillator input frequency range (oscillator enabled by setting bit, tcs (t1con<1>)) dc 50 khz ta20 t ckextmrl delay from external t1ck clock edge to timer increment 0.75 t cy + 40 1.75 t cy + 40 ns note 1: timer1 is a type a timer. 2: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 284 ? 2015-2016 microchip technology inc. table 25-25: timer2 (type b timer) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions tb10 ttxh t2ck high time synchronous mode greater of: 20 or (t cy + 20)/n ns must also meet parameter tb15, n = prescale value (1, 8, 64, 256) tb11 ttxl t2ck low time synchronous mode greater of: 20 or (t cy + 20)/n ns must also meet parameter tb15, n = prescale value (1, 8, 64, 256) tb15 ttxp t2ck input period synchronous mode greater of: 40 or (2 t cy + 40)/n ns n = prescale value (1, 8, 64, 256) tb20 t ckextmrl delay from external t2ck clock edge to timer increment 0.75 t cy + 40 1.75 t cy + 40 ns note 1: these parameters are characterized but not tested in manufacturing. table 25-26: timer3 (type c timer) external clock timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions tc10 ttxh t3ck high time synchronous t cy + 20 ns must also meet parameter tc15 tc11 ttxl t3ck low time synchronous t cy + 20 ns must also meet parameter tc15 tc15 ttxp t3ck input period synchronous with prescaler 2 t cy + 40 ns n = prescale value (1, 8, 64, 256) tc20 t ckextmrl delay from external t3ck clock edge to timer increment 0.75 t cy + 40 1.75 t cy + 40 ns note 1: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 285 dspic33epxxgs202 family figure 25-6: input capture 1 (ic1) timing characteristics ic1 ic10 ic11 ic15 note: refer to figure 25-1 for load conditions. table 25-27: input capture 1 module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param. no. symbol characteristics ( 1 ) min. max. units conditions ic10 t cc l ic1 input low time greater of: 12.5 + 25 or (0.5 t cy /n) + 25 ns must also meet parameter ic15 n = prescale value (1, 4, 16) ic11 t cc h ic1 input high time greater of: 12.5 + 25 or (0.5 t cy /n) + 25 ns must also meet parameter ic15 ic15 t cc p ic1 input period greater of: 25 + 50 or (1 t cy /n) + 50 n s note 1: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 286 ? 2015-2016 microchip technology inc. figure 25-7: output compare 1 module (o c1) timing characteristics figure 25-8: oc1/pwmx module timing characteristics oc1 oc11 oc10 (output compare 1 note: refer to figure 25-1 for load conditions. or pwm mode) table 25-28: output compare 1 module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions oc10 tccf oc1 output fall time ns see parameter do32 oc11 tccr oc1 output rise time ns see parameter do31 note 1: these parameters are characterized but not tested in manufacturing. ocfa oc1 oc20 oc15 table 25-29: oc1/pwmx module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions oc15 t fd fault input to pwmx i/o change t cy + 20 ns oc20 t flt fault input pulse width t cy + 20 ns note 1: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 287 dspic33epxxgs202 family figure 25-9: high-speed pwmx module fault timing characteristics figure 25-10: high-speed pwmx module timing characteristics fault input pwmx mp30 mp20 (active-low) pwmx mp11 mp10 note: refer to figure 25-1 for load conditions. table 25-30: high-speed pwmx module timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. max. units conditions mp10 t fpwm pwmx output fall time ns see parameter do32 mp11 t rpwm pwmx output rise time ns see parameter do31 mp20 t fd fault input ? to pwmx i/o change 1 5n s mp30 t fh fault input pulse width 15 ns note 1: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 288 ? 2015-2016 microchip technology inc. table 25-31: spi1 maximu m data/clock rate summary figure 25-11: spi1 master mode (half-duplex, transmit only, cke = 0 ) timing characteristics ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended maximum data rate master transmit only (half-duplex) master transmit/receive (full-duplex) slave transmit/receive (full-duplex) cke ckp smp 15 mhz table 25-31 0 , 10 , 10 , 1 9 mhz table 25-32 10 , 11 9 mhz table 25-33 00 , 11 15 mhz table 25-34 100 11 mhz table 25-35 110 15 mhz table 25-36 010 11 mhz table 25-37 000 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp10 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 25-1 for load conditions. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 289 dspic33epxxgs202 family figure 25-12: spi1 master mode ( half-duplex, transmit only, cke = 1 ) timing characteristics table 25-32: spi1 master mode (half-duple x, transmit only) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency 15 mhz ( note 3 ) sp20 tscf sck1 output fall time ns see parameter do32 ( note 4 ) sp21 tscr sck1 output rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 62 0n s sp36 tdiv2sch, tdiv2scl sdo1 data output setup to first sck1 edge 30 ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 25-1 for load conditions. sp36 sp10 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 290 ? 2015-2016 microchip technology inc. figure 25-13: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing characteristics table 25-33: spi1 master mode (full-duplex, cke = 1 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency 9 mhz ( note 3 ) sp20 tscf sck1 output fall time ns see parameter do32 ( note 4 ) sp21 tscr sck1 output rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 6 20 ns sp36 tdov2sc, tdov2scl sdo1 data output setup to first sck1 edge 30 ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ns sp41 tsch2dil, tscl2dil hold time of sdi1 data input to sck1 edge 30 ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp21 sp20 sp35 sp20 sp21 lsb bit 14 - - - - - -1 sp30, sp31 note: refer to figure 25-1 for load conditions. sp36 sp41 lsb in bit 14 - - - -1 sdi1 sp40 sp10 msb in msb downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 291 dspic33epxxgs202 family figure 25-14: spi1 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing characteristics table 25-34: spi1 master mode (full-duplex, cke = 0 , ckp = x , smp = 1 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp10 fscp maximum sck1 frequency 9 mhz -40c to +125c ( note 3 ) sp20 tscf sck1 output fall time ns see parameter do32 ( note 4 ) sp21 tscr sck1 output rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 62 0n s sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 3 0 n s sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 3 0 n s sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 3 0 n s note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 111 ns. the clock generated in master mode must not violate this specification. 4: assumes 50 pf load on all spi1 pins. sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sdi1 sp40 sp41 sp21 sp20 sp35 sp20 sp21 msb lsb bit 14 - - - - - -1 lsb in bit 14 - - - -1 sp30, sp31 sp30, sp31 note: refer to figure 25-1 for load conditions. sp36 sp10 msb in downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 292 ? 2015-2016 microchip technology inc. figure 25-15: spi1 slave mode (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing characteristics ss1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp60 sdi1 sp30, sp31 msb bit 14 - - - - - -1 lsb sp51 bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp40 sp41 note: refer to figure 25-1 for load conditions. sp36 sp50 sp70 sp35 msb in downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 293 dspic33epxxgs202 family table 25-35: spi1 slave mode (full-duplex, cke = 1 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency lesser of: f p or 15 mhz ( note 3 ) sp72 tscf sck1 input fall time ns see parameter do32 ( note 4 ) sp73 tscr sck1 input rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ns sp41 tsch2dil, tscl2dil hold time of sdi1 data input to sck1 edge 30 ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 50 ns ( note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ns ( note 4 ) sp60 tssl2dov sdo1 data output valid after ss1 edge 50 ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 294 ? 2015-2016 microchip technology inc. figure 25-16: spi1 slave mode (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing characteristics ss1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp60 sdi1 sp30, sp31 msb bit 14 - - - - - -1 lsb sp51 bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 sp70 sp40 sp41 note: refer to figure 25-1 for load conditions. sp36 sp50 sp35 msb in downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 295 dspic33epxxgs202 family table 25-36: spi1 slave mode (full-duplex, cke = 1 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency lesser of: f p or 11 mhz ( note 3 ) sp72 tscf sck1 input fall time ns see parameter do32 ( note 4 ) sp73 tscr sck1 input rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ns sp41 tsch2dil, tscl2dil hold time of sdi1 data input to sck1 edge 30 ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 50 ns ( note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ns ( note 4 ) sp60 tssl2dov sdo1 data output valid after ss1 edge 50 ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 91 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 296 ? 2015-2016 microchip technology inc. figure 25-17: spi1 slave mode (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing characteristics ss 1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp40 sp41 sp30, sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 note: refer to figure 25-1 for load conditions. sdi1 sp70 sp36 msb in downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 297 dspic33epxxgs202 family table 25-37: spi1 slave mode (full-duplex, cke = 0 , ckp = 1 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency 15 mhz ( note 3 ) sp72 tscf sck1 input fall time ns see parameter do32 ( note 4 ) sp73 tscr sck1 input rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 50 ns ( note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ns ( note 4 ) note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 66.7 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 298 ? 2015-2016 microchip technology inc. figure 25-18: spi1 slave mode (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing characteristics ss 1 sck1 (ckp = 0 ) sck1 (ckp = 1 ) sdo1 sp50 sp40 sp41 sp30, sp31 sp51 sp35 msb lsb bit 14 - - - - - -1 bit 14 - - - -1 lsb in sp52 sp73 sp72 sp72 sp73 note: refer to figure 25-1 for load conditions. sdi1 sp70 sp36 msb in downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 299 dspic33epxxgs202 family table 25-38: spi1 slave mode (full-duplex, cke = 0 , ckp = 0 , smp = 0 ) timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions sp70 fscp maximum sck1 input frequency 11 mhz ( note 3 ) sp72 tscf sck1 input fall time ns see parameter do32 ( note 4 ) sp73 tscr sck1 input rise time ns see parameter do31 ( note 4 ) sp30 tdof sdo1 data output fall time ns see parameter do32 ( note 4 ) sp31 tdor sdo1 data output rise time ns see parameter do31 ( note 4 ) sp35 tsch2dov, tscl2dov sdo1 data output valid after sck1 edge 6 20 ns sp36 tdov2sch, tdov2scl sdo1 data output setup to first sck1 edge 30 ns sp40 tdiv2sch, tdiv2scl setup time of sdi1 data input to sck1 edge 30 ns sp41 tsch2dil, ts c l 2 d i l hold time of sdi1 data input to sck1 edge 30 ns sp50 tssl2sch, tssl2scl ss1 ? to sck1 ? or sck1 ?? input 120 ns sp51 tssh2doz ss1 ? to sdo1 output high-impedance 10 50 ns ( note 4 ) sp52 tsch2ssh, tscl2ssh ss1 ?? after sck1 edge 1.5 t cy + 40 ns ( note 4 ) note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. 3: the minimum clock period for sck1 is 91 ns. therefore, the sck1 clock generated by the master must not violate this specification. 4: assumes 50 pf load on all spi1 pins. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 300 ? 2015-2016 microchip technology inc. figure 25-19: i2c1 bus start/stop bits ti ming characteristics (master mode) figure 25-20: i2c1 bus data timing characteristics (master mode) scl1sda1 start condition stop condition note: refer to figure 25-1 for load conditions. im31 im30 im34 im33 im11 im10 im33 im11 im10 im20 im26 im25 im40 im40 im45 im21 scl1 sda1 in sda1 out note: refer to figure 25-1 for load conditions. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 301 dspic33epxxgs202 family table 25-39: i2c1 bus data timing requirements (master mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 4 ) min. ( 1 ) max. units conditions im10 t lo : scl clock low time 100 khz mode t cy (brg + 1) ? s 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im11 t hi : scl clock high time 100 khz mode t cy (brg + 1) ? s 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im20 t f : scl sda1 and scl1 fall time 100 khz mode 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 2 ) 100 ns im21 t r : scl sda1 and scl1 rise time 100 khz mode 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 2 ) 300 ns im25 t su : dat data input setup time 100 khz mode 250 ns 400 khz mode 100 ns 1 mhz mode ( 2 ) 40 ns im26 t hd : dat data input hold time 100 khz mode 0 ? s 400 khz mode 0 0.9 ? s 1 mhz mode ( 2 ) 0.2 ? s im30 t su : sta start condition setup time 100 khz mode t cy (brg + 1) ? s only relevant for repeated start condition 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im31 t hd : sta start condition hold time 100 khz mode t cy (brg + 1) ? s after this period, the first clock pulse is generated 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im33 t su : sto stop condition setup time 100 khz mode t cy (brg + 1) ? s 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im34 t hd : sto stop condition hold time 100 khz mode t cy (brg + 1) ? s 400 khz mode t cy (brg + 1) ? s 1 mhz mode ( 2 ) t cy (brg + 1) ? s im40 t aa : scl output valid from clock 100 khz mode 3500 ns 400 khz mode 1000 ns 1 mhz mode ( 2 ) 400 ns im45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode ( 2 ) 0.5 ? s im50 c b bus capacitive loading 400 pf im51 t pgd pulse gobbler delay 65 390 ns ( note 3 ) note 1: brg is the value of the i 2 c baud rate generator. 2: maximum pin capacitance = 10 pf for all i2c1 pins (for 1 mhz mode only). 3: typical value for this parameter is 130 ns. 4: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 302 ? 2015-2016 microchip technology inc. figure 25-21: i2c1 bus start/stop bits timing characteristics (slave mode) figure 25-22: i2c1 bus data timing characteristics (slave mode) scl1sda1 start condition stop condition is30 is31 is34 is33 is30 is31 is33 is11 is10 is20 is25 is40 is40 is45 is21 scl1 sda1 in sda1 out is26 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 303 dspic33epxxgs202 family table 25-40: i2c1 bus data timing requirements (slave mode) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic ( 3 ) min. max. units conditions is10 t lo : scl clock low time 100 khz mode 4.7 ? s 400 khz mode 1.3 ? s 1 mhz mode ( 1 ) 0.5 ? s is11 t hi : scl clock high time 100 khz mode 4.0 ? s device must operate at a minimum of 1.5 mhz 400 khz mode 0.6 ? s device must operate at a minimum of 10 mhz 1 mhz mode ( 1 ) 0.5 ? s is20 t f : scl sda1 and scl1 fall time 100 khz mode 300 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 1 ) 1 0 0n s is21 t r : scl sda1 and scl1 rise time 100 khz mode 1000 ns c b is specified to be from 10 to 400 pf 400 khz mode 20 + 0.1 c b 300 ns 1 mhz mode ( 1 ) 3 0 0n s is25 t su : dat data input setup time 100 khz mode 250 ns 400 khz mode 100 ns 1 mhz mode ( 1 ) 100 ns is26 t hd : dat data input hold time 100 khz mode 0 ? s 400 khz mode 0 0.9 ? s 1 mhz mode ( 1 ) 00 . 3 ? s is30 t su : sta start condition setup time 100 khz mode 4.7 ? s only relevant for repeated start condition 400 khz mode 0.6 ? s 1 mhz mode ( 1 ) 0.25 ? s is31 t hd : sta start condition hold time 100 khz mode 4.0 ? s after this period, the first clock pulse is generated 400 khz mode 0.6 ? s 1 mhz mode ( 1 ) 0.25 ? s is33 t su : sto stop condition setup time 100 khz mode 4.7 ? s 400 khz mode 0.6 ? s 1 mhz mode ( 1 ) 0.6 ? s is34 t hd : sto stop condition hold time 100 khz mode 4 ? s 400 khz mode 0.6 ? s 1 mhz mode ( 1 ) 0.25 ? s is40 t aa : scl output valid from clock 100 khz mode 0 3500 ns 400 khz mode 0 1000 ns 1 mhz mode ( 1 ) 03 5 0n s is45 t bf : sda bus free time 100 khz mode 4.7 ? s time the bus must be free before a new transmission can start 400 khz mode 1.3 ? s 1 mhz mode ( 1 ) 0.5 ? s is50 c b bus capacitive loading 400 pf is51 t pgd pulse gobbler delay 65 390 ns ( note 2 ) note 1: maximum pin capacitance = 10 pf for all i2c1 pins (for 1 mhz mode only). 2: typical value for this parameter is 130 ns. 3: these parameters are characterized but not tested in manufacturing. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 304 ? 2015-2016 microchip technology inc. figure 25-23: uart1 module i/o timing characteristics table 25-41: uart1 module i/o timing requirements ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +125c param no. symbol characteristic ( 1 ) min. typ. ( 2 ) max. units conditions ua10 t uabaud uart1 baud time 66.67 ns ua11 f baud uart1 baud frequency 15 mbps ua20 t cwf start bit pulse width to trigger uart1 wake-up 500 ns note 1: these parameters are characterized but not tested in manufacturing. 2: data in typ. column is at 3.3v, +25c unless otherwise stated. parameters are for design guidance only and are not tested. ua20 u1rx msb in lsb in bits 6-1 ua10 u1tx downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 305 dspic33epxxgs202 family table 25-42: adc mo dule specifications ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 4 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics ( 3 ) min. typical max. units conditions device supply ad01 av dd module v dd supply greater of: v dd C 0.3 or 3.0 lesser of: v dd + 0.3 or 3.6 v the difference between av dd supply and v dd supply must not exceed 300 mv at all times, including device power-up ad02 av ss module v ss supply v ss v ss + 0.3 v analog input ad12 v inh -v inl full-scale input span av ss a v dd v ad14 v in absolute input voltage av ss C 0.3 av dd + 0.3 v ad15 v in + pseudo-differential mode 0 3.3 v v in - = (vr+ + vr-)/2 150 mv ad16 v in - pseudo-differential mode 03 . 3v v in + = (vr+ + vr-)/2 150 mv ad17 r in recommended impedance of analog voltage source 1 0 0 ? for minimum sampling time ( note 1 ) ad66 v ref 1 internal voltage reference source 1 . 2v adc accuracy: pseudo-differential input ad20a nr resolution 12 bits ad21a inl integral nonlinearity > -4 < 4 lsb av ss = 0v, av dd = 3.3v ad22a dnl pseudo-differential nonlinearity > -1 < 1 lsb av ss = 0v, av dd = 3.3v ( note 5 ) ad23a g err gain error (dedicated core) > -5 < 5 lsb av ss = 0v, av dd = 3.3v ad24a e off offset error (dedicated core) > -5 < 5 lsb av ss = 0v, av dd = 3.3v ad25a monotonicity guaranteed note 1: these parameters are not characterized or tested in manufacturing. 2: these parameters are characterized but not tested in manufacturing. 3: characterized with a 1 khz sine wave. 4: the adc module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is ensured, but not characterized. 5: no missing codes, limits are based on the characterization results. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 306 ? 2015-2016 microchip technology inc. adc accuracy: single-ended input ad20b nr resolution 12 bits ad21b inl integral nonlinearity > -4 < 4 lsb av ss = 0v, av dd = 3.3v ad22b dnl pseudo-differential nonlinearity > -1 < 1.5 lsb av ss = 0v, av dd = 3.3v ( note 5 ) ad23b g err gain error (dedicated core) > -5 < 5 lsb av ss = 0v, av dd = 3.3v gain error (shared core) > -5 < 5 lsb av ss = 0v, av dd = 3.3v, -40c ? t a ? +85c > -6 < 6 lsb av ss = 0v, av dd = 3.3v, -85c ? t a ? +125c ad24b e off offset error (dedicated core) 07< 1 2 l s b a v ss = 0v, av dd = 3.3v offset error (shared core) 07< 1 2 l s b ad25b monotonicity guaranteed dynamic performance ad31b sinad signal-to-noise and distortion 63 > 65 db ( notes 2 , 3 ) ad34b enob effective number of bits 10.3 bits ( notes 2 , 3 ) table 25-42: adc module spe cifications (continued) ac characteristics standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 4 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics ( 3 ) min. typical max. units conditions note 1: these parameters are not characterized or tested in manufacturing. 2: these parameters are characterized but not tested in manufacturing. 3: characterized with a 1 khz sine wave. 4: the adc module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is ensured, but not characterized. 5: no missing codes, limits are based on the characterization results. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 307 dspic33epxxgs202 family table 25-43: analog-to-digital co nversion timing requirements ac characteristics ( 2 ) standard operating conditions: 3.0v to 3.6v (unless otherwise stated) ( 2 ) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristics min. typ. ( 1 ) max. units conditions clock parameters ad50 t ad adc clock period 14.28 ns throughput rate ad51 f tp adc core 0, 1, 2 3.25 msps 70 mhz adc clock, 12 bits, no pending conversions at time of trigger note 1: these parameters are characterized but not tested in manufacturing. 2: the adc module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is guaranteed, but not characterized. table 25-44: high-speed analog co mparator module specifications ac/dc characteristics ( 2 ) standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units comments cm10 v ioff input offset voltage -35 5 +35 mv cm11 v icm input common-mode voltage range ( 1 ) 0a v dd v cm13 cmrr common-mode rejection ratio 60 db cm14 t resp large signal response 15 ns v+ input step of 100 mv while v- input is held at av dd /2. delay measured from analog input pin to pwmx output pin. cm15 v hyst input hysteresis 5 10 20 mv depends on hyssel<1:0> cm16 t on comparator enabled to valid output 1 s note 1: these parameters are for design guidance only and are not tested in manufacturing. 2: the comparator module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is tested, but not characterized. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 308 ? 2015-2016 microchip technology inc. table 25-45: dacx module specifications ac/dc characteristics ( 2 ) standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units comments da02 cv res resolution 12 bits da03 inl integral nonlinearity error -12 lsb da04 dnl differential nonlinearity error -1.8 0.5 1.8 lsb da05 eoff offset error 20 mv da06 eg gain error -0.8 -0.4 % da07 t set settling time ( 1 ) 700 ns output with 2% of desired output voltage with a 10-90% or 90-10% step note 1: parameters are for design guidance only and are not tested in manufacturing. 2: the dacx module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is tested, but not characterized. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 309 dspic33epxxgs202 family table 25-46: pgax mo dule specifications ac/dc characteristics ( 1 ) standard operating conditions: 3.0v to 3.6v (unless otherwise stated) operating temperature -40c ? t a ? +85c for industrial -40c ? t a ? +125c for extended param no. symbol characteristic min. typ. max. units comments pa01 v in input voltage range av ss C 0.3 av dd + 0.3 v pa02 v cm common-mode input voltage range av ss a v dd C 1.6 v pa03 v os input offset voltage -20 +20 mv pa04 v os input offset voltage drift with temperature ? 15 v/ ? c pa05 r in + input impedance of positive input >1m || 7 pf ? || pf pa06 r in - input impedance of negative input 10k || 7 pf ? || pf pa07 g err gain error -2 +2 % gain = 4x and 8x -3 +3 % gain = 16x -4 +4 % gain = 32x and 64x pa08 l err gain nonlinearity error 0.5 % % of full scale, gain = 16x pa09 i dd current consumption 2.0 ma module is enabled with a 2-volt p-p output voltage swing pa10a bw small signal bandwidth (-3 db) g = 4x 10 mhz pa10b g = 8x 5 mhz pa10c g = 16x 2.5 mhz pa10d g = 32x 1.25 mhz pa10e g = 64x 0.625 mhz pa11 ost output settling time to 1% of final value 0.4 s gain = 16x, 100 mv input step change pa12 sr output slew rate 40 v/s gain = 16x pa13 t gsel gain selection time 1 s pa14 t on module turn on/setting time 1 0 s note 1: the pgax module is functional at v bormin < v dd < v ddmin , but with degraded performance. unless otherwise stated, module functionality is tested, but not characterized. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 310 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 311 dspic33epxxgs202 family 26.0 dc and ac device characteristics graphs figure 26-1: v oh ? 4x driver pins figure 26-2: v oh ? 8x driver pins figure 26-3: v ol ? 4x driver pins figure 26-4: v ol ? 8x driver pins note: the graphs provided following this note are a statistical summar y based on a limited number of samples and are provided for design guidance purposes only. the performance characteristics listed herein are not tested or guaranteed. in some graphs, the data presented ma y be out side the specified operating range (e.g., outside specified power supply range) and therefore, outside the warranted range. -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 ioh(a) voh (v) -0.050 -0.045 -0.040 -0.035 -0.030 -0.025 -0.020 -0.015 -0.010 -0.005 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh (v) 3v 3.3v 3.6v absolute maximum -0.080 -0.070 -0.060 -0.050 -0.040 0 030 ioh(a) voh  (v) -0.080 -0.070 -0.060 -0.050 -0.040 -0.030 -0.020 -0.010 0.000 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) voh  (v) 3v 3.3v 3.6v absolute maximum 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 ioh(a) vol  (v) 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol  (v) 3v 3.3v 3.6v absolute maximum iol(a) 0020 0.030 0.040 0.050 0.060 0.070 0.080 ioh(a) vol  (v) 8x 0.000 0.010 0.020 0.030 0.040 0.050 0.060 0.070 0.080 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 ioh(a) vol  (v) 8x 3v 3.3v 3.6v absolute maximum iol(a) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 312 ? 2015-2016 microchip technology inc. figure 26-5: typical i pd current @ v dd = 3.3v figure 26-6: typical i dd current @ v dd = 3.3v, +25c figure 26-7: typical i doze current @ v dd = 3.3v, +25c figure 26-8: typical i idle current @ v dd = 3.3v, +25c 0 50 100 150 200 250 300 -40 -20 0 20 40 60 80 100 120 i pd current (a) temperature (celsius) 5 10 15 20 25 30 10 20 30 40 50 60 70 i dd current (ma) mips 5 7 9 11 13 15 17 19 21 23 25 1:1 1:128 1:2 1:64 doze ratio i doze current ( ma ) 0 1 2 3 4 5 6 7 8 9 10 20 30 40 50 60 70 i idle current (ma) mips downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 313 dspic33epxxgs202 family figure 26-9: typical frc frequency @ v dd = 3.3v figure 26-10: typical lprc frequency @ v dd = 3.3v 7150 7200 7250 7300 7350 7400 -40 -20 0 20 40 60 80 100 120 frc frequency (khz) temperature (celsius) 33 33.2 33.4 33.6 33.8 34 34.2 34.4 -40 -20 0 20 40 60 80 100 120 lprc frequency (khz) temperature (celsius) downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 314 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 315 dspic33epxxgs202 family 27.0 packaging information 27.1 package marking information legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week 01) nnn alphanumeric traceability code note: in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line, thus limiting the number of available characters for customer-specific information. 28-lead ssop xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn example dspic33ep16 gs202 1610017 28-lead soic (.300) xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx yywwnnn example dspic33ep32gs202 1610017 28-lead uqfn (4x4x0.6 mm) xxxxxxxx xxxxxxxx yywwnnn 33ep32 gs202 1610017 example xxxxxxxx 28-lead qfn-s (6x6x0.9 mm) xxxxxxxx yywwnnn 33ep32 example gs202 1610017 28-lead uqfn (6x6x0.5 mm) xxxxxxxx xxxxxxxx yywwnnn 33ep32 gs202 1610017 example downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 316 ? 2015-2016 microchip technology inc. 27.2 package details 
           ! "
# $  %   !" # $% &" '  ()"&'"!&)  & #*&&  & #    ' !! #+#&"# '#% !
&"!!#% !
&"!!! & $ #''
!#  , ' !  #&   
+-. /01 / !' !  &  $ & " !**&"&&   ! +21  %   ' !("!" *&"&&   (%%' &
"
! ! $ % 2& '!&" &
3 # * !(
 ! ! & 
 3  
% & & # & &&
144***'
'4
3  5&! 66++ ' !6'&! 7 78 9 7"') %! 7 : & ./0 8  ;  &  < <  # # 3 3 !!  . . :. & #%%  . < < 8  =#& +  : : # # 3 =#& + . ., . 8  6  &    . 2&6  & 6 .. . . 2&
& 6 .+2 6 #3 !!   < . 2&  > > :> 6 #=#& )  < ,: l l1 c a2 a1 a e e1 d n 1 2 note 1 b e 
    * 0 ,/ downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 317 dspic33epxxgs202 family note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 318 ? 2015-2016 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 319 dspic33epxxgs202 family note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 320 ? 2015-2016 microchip technology inc. note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 321 dspic33epxxgs202 family b a 0.10 c 0.10 c 0.07 c a b 0.05 c (datum b) (datum a) c seating plane note 1 1 2 n 2x top view side view bottom view for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging note: note 1 1 2 n 0.10 c a b 0.10 c a b 0.10 c 0.08 c microchip technology drawing c04-333-m6 rev b sheet 1 of 2 28-lead ultra thin plastic quad flat, no lead package (m6) - 4x4x0.6 mm body [uqfn] d e a (a3) 28x b e e 2 2x d2 e2 k l 28x a1 with corner anchors 4x b2 4x b2 4x b1 4x b1 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 322 ? 2015-2016 microchip technology inc. microchip technology drawing c04-333-m6 rev a sheet 2 of 2 for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging note: number of pins overall height terminal width overall width overall length terminal length exposed pad width exposed pad length terminal thickness pitch standoff units dimension limits a1 a b d e2 d2 a3 e l e n 0.40 bsc 0.152 ref 1.801.80 0.30 - 0.00 4.00 bsc 0.45 1.90 1.90 - 0.02 4.00 bsc millimeters min nom 28 2.002.00 0.50 0.600.05 max k0 . 6 0 -- ref: reference dimension, usually without tolerance, for information purposes only. bsc: basic dimension. theoretically exact value shown without tolerances. 1.2. 3. noes: pin 1 visual index feature may vary, but must be located within the hatched area. package is saw singulated dimensioning and tolerancing per asme y14.5m terminal-to-exposed-pad 28-lead ultra thin plastic quad flat, no lead package (m6) - 4x4x0.6 mm body [uqfn] corner anchor pad b1 0.15 0.20 0.25 with corner anchors corner pad, metal free zone b2 0.40 0.45 0.50 0.18 0.23 0.28 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 323 dspic33epxxgs202 family recommended land pattern for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging note: dimension limits units c2 center pad width contact pad spacing center pad length contact pitch y2 x2 2.00 2.00 millimeters 0.40 bsc min e max contact pad length (x28) contact pad width (x28) y1 x1 0.85 0.20 bsc: basic dimension. theoretically exact value shown without tolerances. notes: 1. dimensioning and tolerancing per asme y14.5m microchip technology drawing c04-2333-m6 rev b nom 28-lead ultra thin plastic quad flat, no lead package (m6) - 4x4x0.6 mm body [uqfn] silk screen 12 28 c1 c2 e x1 y1 y2 x2 c1 contact pad spacing 3.90 contact pad to center pad (x28) g1 0.52 thermal via diameter v thermal via pitch ev 0.301.00 ?v ev ev g3 g1 x3 y3 corner anchor length (x4) corner anchor width (x4) y3 x3 0.78 0.78 3.90 with corner anchors contact pad to pad (x24) g2 0.20 g2 contact pad to corner pad (x8) g3 0.20 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 324 ? 2015-2016 microchip technology inc. b a 0.15 c 2x 0.15 c for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging microchip technology drawing c04-0209 rev c sheet 1 of 2 c note: 2x 0.08 c 0.10 c a b 0.05 c seating plane n n top view side view bottom view note 1 note 4 (datum a) (datum b) d e (a3) a1 a d2 e2 l k b 0.10 c 0.10 c a b 21 2 1 note 4 28-lead plastic quad flat, no lead package (mx) - 6x6x0.5mm body [uqfn] ultra-thin with 0.40 x 0.60 mm terminal width/length and corner anchors 4x b1 4x b2 0.10 c a b 4x b1 e 4x b2 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 325 dspic33epxxgs202 family note: for the most current package drawings, please see the microchip packaging specification located at http://www.microchip.com/packaging number of pins overall width overall length overall height terminal length exposed pad width exposed pad length standoff pitch d2 l d units dimension limits a1e2 e a e n 0.55 0.60 6.00 bsc 4.00 millimeters 0.65 bsc 0.00 0.40 min 6.00 bsc 0.500.02 4.00 nom 28 0.65 0.600.05 max k- 0.20 - ref: reference dimension, usually without tolerance, for information purposes only. bsc: basic dimension. theoretically exact value shown without tolerances. 1. 2.3. noes: terminal thickness (a3) 0.127 ref terminal-to-exposed pad corner pad, metal free zone b2 0.15 0.20 0.25 terminal width b 0.35 0.40 0.45 pin 1 visual index feature may vary, but must be located within the hatched area. package is saw singulated dimensioning and tolerancing per asme y14.5m 4. outermost portions of corner structures may vary slightly. corner pad b1 0.55 0.60 0.65 microchip technology drawing c04-0209 rev c sheet 2 of 2 28-lead plastic quad fla t, no lead package (mx) - 6x6x0.5mm body [uqfn] ultra-thin with 0.40 x 0.60 mm terminal width/length and corner anchors downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 326 ? 2015-2016 microchip technology inc. note: corner anchor pads are not connected internally and are designed as mechanical features when the package is soldered to the pcb. )ruwkhprvwfxuuhqwsdfndjhgudzlqjvsohdvhvhhwkh0lfurfkls 3dfndjlqj6shflilfdwlrqorfdwhgdw kwwszzzplfurfklsfrpsdfndjlqj note: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 327 dspic33epxxgs202 family downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 328 ? 2015-2016 microchip technology inc. downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 329 dspic33epxxgs202 family 
  & '  ( $ 
) **  +,+,-   ! "&'$# .  /  0   )  $ % 2& '!&" &
3 # * !(
 ! ! & 
 3  
% & & # & &&
144***'
'4
3  downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 330 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 331 dspic33epxxgs202 family appendix a: revision history revision a (january 2015) this is the initial version of this document. revision b (may 2015) changes to register 19-7 adcon4l. changes to the hysteresis values in section 20.6 ?hysteresis? and register 20-1 cmpxcon. a note has been added to table 23-2 instruction set overview. changes to section 25.0 ?electrical characteristics? . new packaging diagrams have been added to section 27.0 ?packaging information? . minor text edits throughout document. revision c (november 2015) changes for this revision of the document have been effected in the following: adds: - section 4.2 ?unique device identifier (udid)? removes: - table 4-21: jtag interface register map updates and modifies: - tables: table 4-3 ; ta b l e 4 - 1 4 ; table 4-17 ; tab l e 2 2- 1 ; table 25-6 ; table 25-8 ; table 25-9 ; table 25-13 ; table 25-42 ; table 25-44 ; table 25-45 -figures: figure 19-1 ; figure 19-2 ; figure 19-3 -registers: register 19-16 ; register 19-22 ; register 19-23 replaces: - register 19-20 - three revised drawings of 28-lead ultra thin plastic quad flat (m6) 4x4x0.6 mm body in section 27.0 ?packaging information? revision d (may 2016) this revision of the document: adds a new chapter section 26.0 ?dc and ac device characteristics graphs? updates table 25-2 and register 19-23 modifies the ?qualification and class b support? section provides the family device number in section 4.2 ?unique device identifier (udid)? wherever applicable, changes occurrences of pwmx to pwm downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 332 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 333 dspic33epxxgs202 family index a absolute maximum ratings .............................................. 265 ac characteristics ............................................................ 277 adc specifications ................................................... 305 analog-to-digital conversion requirements............. 307 auxiliary pll clock ................................................... 279 capacitive loading requirements on output pins ....................................................... 277 external clock requirements ................................... 278 high-speed pwmx requirements ............................ 287 i/o requirements............................................. ......... 281 i2c1 bus data requirements (master mode)........... 301 i2c1 bus data requirements (slave mode)............. 303 input capture 1 requirements.................................. 285 internal frc accuracy.............................................. 280 internal lprc accuracy............................................ 280 load conditions ............................................... ......... 277 oc1/pwmx mode requirements.............................. 286 output compare 1 requirements ............................. 286 pll clock.................................................................. 279 reset, wdt, ost, pwrt requirements ................. 282 spi1 master mode (full-duplex, cke = 0, ckp = x, smp = 1) requirements .................... 291 spi1 master mode (full-duplex, cke = 1, ckp = x, smp = 1) requirements .................... 290 spi1 master mode (half-duplex, transmit only) requirements ................................................ ... 289 spi1 maximum data/clock rate summary .............. 288 spi1 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) requirements .................... 299 spi1 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) requirements .................... 297 spi1 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) requirements .................... 293 spi1 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) requirements .................... 295 temperature and voltage specifications .................. 277 timer1 external clock requirements ....................... 283 timer2 external clock requirements ....................... 284 timer3 external clock requirements ....................... 284 uart1 i/o requirements ......................................... 304 ac/dc characteristics dacx specifications ................................................. 308 high-speed analog comparator specifications.................................................... 307 pgax specifications ................................................. 309 arithmetic logic unit (alu)................................................. 26 assembler mpasm assembler................................................... 262 b bit-reversed addressing .................................................... 56 example ...................................................................... 57 implementation ........................................................... 56 sequence table (16-entry)......................................... 57 block diagrams 16-bit timer1 module .......................................... ..... 133 adc module ............................................... .............. 200 addressing for table registers .................................. 61 call stack frame ..................................................... 52 connections for on-chip voltage regulator ............ 246 cpu core ................................................................... 18 data access from program space address generation.............................................. ............ 58 dedicated adc core 0-1.......................................... 201 dspic33epxxgs202 family ....................................... 7 high-speed analog comparator x............................ 230 high-speed pwm architecture................................. 153 hysteresis control .................................................... 232 i2c1 module ............................................. ................ 186 input capture module ........................................... .... 141 interleaved pfc.......................................................... 14 mclr pin connections ............................................ .. 12 multiplexing remappable outputs for rpn .............. 112 off-line ups .............................................................. 16 oscillator system........................................................ 88 pgax functions........................................................ 236 pgax module .............................................. ............. 235 phase-shifted full-bridge converter.......................... 15 pll module ................................................................ 89 programmers model ............................................... ... 20 psv read address generation.................................. 49 recommended minimum connection ........................ 12 remappable input for u1rx .................................... 110 reset system ............................................................. 69 security segments example .................................... 249 shared adc core..................................................... 201 shared port structure............................................... 107 simplified conceptual of high-speed pwm ............. 154 spi1 module ............................................................. 177 suggested oscillator circuit placement ..................... 13 timerx module (x = 2,3)............................................ 138 type b/type c timer pair (32-bit timer) ................. 138 uart1 module ................................................ ......... 193 watchdog timer (wdt)......................................... ... 247 brown-out reset (bor)......................................... ... 239, 246 c c compilers mplab xc ............................................................... 262 code examples port write/read ........................................................ 108 pwm write-protected register unlock sequence ............................................. 152 pwrsav instruction syntax ...................................... 99 code protection ............................................... ......... 239, 248 codeguard security .............................................. ... 239, 248 configuration bits ..................................................... ........ 239 description................................................................ 241 configuration register map .............................................. 240 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 334 ? 2015-2016 microchip technology inc. cpu addressing modes ................................................. ..... 17 clocking system options............................................ 89 fast rc (frc) oscillator .................................... 89 frc oscillator with pll...................................... 89 frc oscillator with postscaler ........................... 89 low-power rc (lprc) oscillator....................... 89 primary (xt, hs, ec) oscillator.......................... 89 primary oscillator with pll................................. 89 control registers ........................................................ 22 data space addressing .............................................. 17 instruction set ............................................................. 17 registers..................................................................... 17 resources................................................................... 21 customer change notification service ............................. 338 customer notification service........................................... 338 customer support ............................................... .............. 338 d data address space ........................................................... 31 memory map for dspic33ep16/32gs202 devices ............................................................... 32 near data space ........................................................ 31 organization, alignment............................................ .. 31 sfr space.................................................................. 31 width........................................................................... 31 data space extended x ................................................ ................. 52 paged data memory space (figure) ........................... 50 paged memory scheme ............................................ . 49 dc characteristics brown-out reset (bor) ............................................ 275 doze current (i doze ) ................................................ 271 i/o pin input specifications ..................................... .. 272 i/o pin output specifications .................................... 275 idle current (i idle ) .................................................... 269 operating current (i dd )............................................. 268 operating mips vs. voltage...................................... 266 power-down current (i pd ) ........................................ 270 program memory ...................................................... 276 temperature and voltage specifications .................. 267 watchdog timer delta current ( ? i wdt ) .................... 270 dc/ac characteristics graphs and tables .............................................. ..... 311 demo/development boards, evaluation and starter kits ................................................................ 264 development support ............................................... ........ 261 device calibration ............................................................. 244 addresses ................................................................. 244 and identification ........................................... ............ 244 doze mode........................................................................ 101 dsp engine......................................................................... 26 e electrical characteristics................................................... 265 ac ............................................................................. 277 equations device operating frequency ...................................... 89 f pllo calculation........................................................ 89 f vco calculation......................................................... 89 errata .................................................................................... 6 f filter capacitor (c efc ) specifications .............................. 267 flash program memory ...................................................... 61 and table instructions ........................................... ..... 61 control registers ...................................................... .. 63 operations .................................................................. 62 resources .................................................................. 63 rtsp operation ......................................................... 62 flexible configuration ....................................................... 239 g getting started guidelines.................................................. 11 connection requirements .......................................... 11 cpu logic filter capacitor connection (v cap ) .......... 12 decoupling capacitors................................................ 11 external oscillator pins............................................... 13 icsp pins ................................................................... 13 master clear (mclr ) pin ........................................... 12 oscillator value conditions on start-up...................... 14 targeted applications ................................................. 14 unused i/os................................................................ 14 h high-speed analog comparator applications .............................................................. 231 control registers ...................................................... 233 description................................................................ 230 digital-to-analog comparator (dac) ........................ 231 features overview.................................................... 229 hysteresis................................................................. 232 pulse stretcher and digital logic.............................. 231 resources ................................................................ 232 high-speed pwm description................................................................ 151 features ................................................................... 151 resources ................................................................ 152 write-protected registers......................................... 152 high-speed, 12-bit analog-to-digital converter (adc) ....................................................... 199 control registers ...................................................... 202 features overview.................................................... 199 resources ................................................................ 202 i i/o ports............................................................................ 107 configuring analog/digital port pins......................... 108 helpful tips............................................................... 113 open-drain configuration......................................... 108 parallel i/o (pio) ...................................................... 107 resources ................................................................ 114 write/read timing .......................................... .......... 108 in-circuit debugger............................................. .............. 248 in-circuit emulation .......................................................... 239 in-circuit serial programming (icsp)....................... 239, 248 input capture .................................................................... 141 control registers ...................................................... 142 resources ................................................................ 141 input change notification (icn)................................... ..... 108 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 335 dspic33epxxgs202 family instruction addressing modes......................................... .... 53 file register instructions ............................................ 53 fundamental modes supported.................................. 53 mac instructions......................................................... 54 mcu instructions ........................................................ 53 move and accumulator instructions............................ 54 other instructions........................................................ 54 instruction set overview ................................................................... 254 summary................................................................... 251 symbols used in opcode descriptions..................... 252 instruction-based power-saving modes ............................. 99 idle ............................................................................ 100 sleep......................................................................... 100 inter-integrated circuit (i 2 c).............................................. 185 control registers ...................................................... 187 resources................................................................. 185 inter-integrated circuit. see i 2 c. internet address................................................................ 338 interrupt controller alternate interrupt vector table (aivt) ...................... 73 control and status registers ...................................... 78 intcon1 ............................................................ 78 intcon2 ............................................................ 78 intcon3 ............................................................ 78 intcon4 ............................................................ 78 inttreg ............................................................ 78 interrupt vector details ............................................... 76 interrupt vector table (ivt) ........................................ 73 reset sequence ................................................ ......... 73 resources................................................................... 78 interrupts coincident with power save instructions.......... 100 j jtag boundary scan interface ....................................... . 239 jtag interface.................................................................. 248 l leading-edge blanking (leb)........................................... 151 lprc oscillator use with wdt ........................................................... 247 m memory organization............................................ .............. 27 resources................................................................... 33 microchip internet web site.............................................. 338 modulo addressing ................................................. ............ 55 applicability ................................................................. 56 operation example ..................................................... 55 start and end address............................................. ... 55 w address register selection .................................... 55 mplab assembler, linker, librarian ................................ 262 mplab icd 3 in-circuit debugger ................................... 263 mplab pm3 device programmer .................................... 263 mplab real ice in-circuit emulator system................. 263 mplab x integrated development environment software............................................... 261 mplink object linker/mplib object librarian ................ 262 o oscillator control registers ...................................................... .. 91 resources................................................................... 90 otp memory area ............................................................ 246 output compare ............................................................... 145 control registers ...................................................... 146 resources................................................................. 145 p packaging......................................................................... 315 details....................................................................... 316 marking..................................................................... 315 peripheral module disable (pmd) .................................... 101 peripheral pin select (pps)........................................... ... 109 available peripherals.............................................. .. 109 available pins ........................................................... 10 9 control ...................................................................... 109 control registers...................................................... 115 input mapping............................................... ............ 110 output mapping ............................................. ........... 112 output selection for remappable pins .................... 112 selectable input sources.......................................... 111 peripheral pin select. see pps. pickit 3 in-circuit debugger/programmer ........................ 263 pinout i/o descriptions (table)................................... ........... 8 power-saving features ...................................................... 99 clock frequency and switching ................................. 99 control registers...................................................... 102 resources ................................................................ 101 program address space..................................................... 27 construction ............................................................... 58 data access from program memory using table instructions ............................................... 59 memory map (DSPIC33EP16GS202 devices)............ 28 memory map (dspic33ep32gs202 devices)............ 29 table read high instructions (tblrdh) ................... 59 table read low instructions (tblrdl) ..................... 59 program memory organization .............................................. ................. 30 reset vector............................................................... 30 programmable gain amplifier (pga)................................ 235 control registers...................................................... 237 description................................................................ 236 resources ................................................................ 237 programmable gain amplifier. see pga. programmers model ............................................... ........... 19 register descriptions ................................................. 19 pulse-width modulation. see pwm. r register maps adc ............................................................................ 43 analog comparator .................................................... 47 cpu core ................................................................... 34 i2c1 ............................................................................ 42 input capture 1........................................................... 38 interrupt controller...................................................... 36 nvm............................................................................ 46 output compare 1 ...................................................... 38 peripheral pin select output ...................................... 45 pmd............................................................................ 46 porta ....................................................................... 48 portb ....................................................................... 48 programmable gain amplifier .................................... 47 pwm........................................................................... 39 pwm generator 1............................................. .......... 39 pwm generator 2............................................. .......... 40 pwm generator 3............................................. .......... 41 spi1............................................................................ 42 system control ........................................................... 46 timer1 through timer3 ............................................... 38 uart1........................................................................ 42 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 336 ? 2015-2016 microchip technology inc. registers aclkcon (auxiliary clock divisor control) ............... 96 adcal0l (adc calibration 0 low) .......................... 222 adcal1h (adc calibration 1 high) ......................... 223 adcmpxcon (adc digital comparator x control) ............................................................. 224 adcmpxenl (adc digital comparator x channel enable low)........................................ 225 adcon1h (adc control 1 high) ............................. 203 adcon1l (adc control 1 low) ............................... 202 adcon2h (adc control 2 high) ............................. 205 adcon2l (adc control 2 low) ............................... 204 adcon3h (adc control 3 high) ............................. 207 adcon3l (adc control 3 low) ............................... 206 adcon4h (adc control 4 high) ............................. 209 adcon4l (adc control 4 low) ............................... 208 adcon5h (adc control 5 high) ............................. 211 adcon5l (adc control 5 low) ............................... 210 adcorexh (dedicated adc core x control high)..................................................... 213 adcorexl (dedicated adc core x control low)...................................................... 212 adeiel (adc early interrupt enable low) ............... 215 adeistatl (adc early interrupt status low) ......... 215 adfl0con (adc digital filter 0 control) ................ 226 adiel (adc interrupt enable low) .......................... 217 adlvltrgl (adc level-sensitive trigger control low) ......................................... 214 admod0h (adc input mode control 0 high) .......... 216 admod0l (adc input mode control 0 low) ........... 216 adstatl (adc data ready status low) ................ 217 adtrigxh (adc channel trigger x selection high).................................................. 220 adtrigxl (adc channel trigger x selection low) .................................................. 218 altdtrx (pwmx alternate dead-time) .................. 167 auxconx (pwmx auxiliary control)........................ 175 chop (pwm chop clock generator)....................... 160 clkdiv (clock divisor)............................................... 93 cmpxcon (comparator x control) .......................... 233 cmpxdac (comparator dacx control) ................... 234 corcon (core control) ...................................... 24, 80 ctxtstat (cpu w register context status) ........... 25 devid (device id) .................................................... 245 devrev (device revision) ...................................... 245 dtrx (pwmx dead-time) ........................................ 167 fclconx (pwmx fault current-limit control) ........ 171 i2c1conh (i2c1 control high)................................ 189 i2c1conl (i2c1 control low) ................................. 187 i2c1msk (i2c1 slave mode address mask) ............ 192 i2c1stat (i2c1 status) ........................................... 190 ic1con1 (input capture control 1).......................... 142 ic1con2 (input capture control 2).......................... 143 intcon1 (interrupt control 1).................................... 81 intcon2 (interrupt control 2).................................... 83 intcon3 (interrupt control 3).................................... 84 intcon4 (interrupt control 4).................................... 84 inttreg (interrupt control and status)..................... 85 ioconx (pwmx i/o control) .................................... 169 lebconx (pwmx leading-edge blanking control) .............................................. 173 lebdlyx (pwmx leading-edge blanking delay)................................................. 174 lfsr (linear feedback shift) .................................... 97 mdc (pwm master duty cycle) ............................... 161 nvmadr (nonvolatile memory lower address) ........ 65 nvmadru (nonvolatile memory upper address) ................................................. . 66 nvmcon (nonvolatile memory (nvm) control)......... 64 nvmkey (nonvolatile memory key) .......................... 66 nvmsrcadrh (nvm source data address high)..................................................... 67 nvmsrcadrl (nvm source data address low)...................................................... 67 oc1con1 (output compare control 1)................... 146 oc1con2 (output compare control 2)................... 148 osccon (oscillator control) ..................................... 91 osctun (frc oscillator tuning).............................. 95 pdcx (pwmx generator duty cycle)....................... 164 pgaxcal (pgax calibration) .................................. 238 pgaxcon (pgax control) ....................................... 237 phasex (pwmx primary phase-shift)..................... 165 pllfbd (pll feedback divisor)................................ 94 pmd1 (peripheral module disable control 1)........... 102 pmd2 (peripheral module disable control 2)........... 103 pmd3 (peripheral module disable control 3)........... 103 pmd6 (peripheral module disable control 6)........... 104 pmd7 (peripheral module disable control 7)........... 105 pmd8 (peripheral module disable control 8)........... 105 ptcon (pwm time base control) .......................... 155 ptcon2 (pwm clock divider select 2)................... 156 ptper (pwm primary master time base period)............................................ 157 pwmcapx (pwmx primary time base capture) ......................................... 176 pwmconx (pwmx control)..................................... 162 pwmkey (pwm protection lock/unlock key)......... 161 rcon (reset control)................................................ 71 rpinr0 (peripheral pin select input 0).................... 115 rpinr1 (peripheral pin select input 1).................... 115 rpinr11 (peripheral pin select input 11)................ 118 rpinr12 (peripheral pin select input 12)................ 119 rpinr13 (peripheral pin select input 13)................ 120 rpinr18 (peripheral pin select input 18)................ 121 rpinr2 (peripheral pin select input 2).................... 116 rpinr20 (peripheral pin select input 20)................ 122 rpinr21 (peripheral pin select input 21)................ 123 rpinr3 (peripheral pin select input 3).................... 117 rpinr37 (peripheral pin select input 37)................ 123 rpinr38 (peripheral pin select input 38)................ 124 rpinr42 (peripheral pin select input 42)................ 125 rpinr43 (peripheral pin select input 43)................ 126 rpinr7 (peripheral pin select input 7).................... 118 rpor0 (peripheral pin select output 0).................. 127 rpor1 (peripheral pin select output 1).................. 127 rpor10 (peripheral pin select output 10).............. 132 rpor2 (peripheral pin select output 2).................. 128 rpor3 (peripheral pin select output 3).................. 128 rpor4 (peripheral pin select output 4).................. 129 rpor5 (peripheral pin select output 5).................. 129 rpor6 (peripheral pin select output 6).................. 130 rpor7 (peripheral pin select output 7).................. 130 rpor8 (peripheral pin select output 8).................. 131 rpor9 (peripheral pin select output 9).................. 131 sdcx (pwmx secondary duty cycle)...................... 164 sevtcmp (pwm special event compare) ............. 157 sphasex (pwmx secondary phase-shift).............. 166 spi1con1 (spi1 control 1) ..................................... 181 spi1con2 (spi1 control 2) ..................................... 183 spi1stat (spi1 status and control)....................... 179 downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 337 dspic33epxxgs202 family sr (cpu status)............................................... 22, 79 ssevtcmp (pwm secondary special event compare)................................... 160 stcon (pwm secondary master time base control)........................................... 158 stcon2 (pwm secondary clock divider select 2)............................................................ 159 stper (pwm secondary master time base period) ............................................ 159 strigx (pwmx secondary trigger compare value)................................................ 172 t1con (timer1 control)........................................... 135 t2con (timer2 control)........................................... 139 t3con (timer3 control)........................................... 140 trgconx (pwmx trigger control).......................... 168 trigx (pwmx primary trigger compare value)................................................ 170 u1mode (uart1 mode) ......................................... 195 u1sta (uart1 status and control) ........................ 197 resets................................................................................. 69 brown-out reset (bor) .............................................. 69 configuration mismatch reset (cm)........................... 69 illegal condition reset (iopuwr).............................. 69 illegal opcode .............................................. ....... 69 security............................................................... 69 uninitialized w register...................................... 69 master clear (mclr ) pin reset ................................. 69 power-on reset (por) ............................................... 69 reset instruction (swr)........................................... 69 resources................................................................... 70 trap conflict reset (trapr)...................................... 69 watchdog timer time-out reset (wdto).................. 69 revision history ................................................................ 331 s serial peripheral interface (spi) ....................................... 177 serial peripheral interface. see spi. software simulator (mplab x sim) ................................. 263 special features of the cpu ............................................ 239 spi control registers ...................................................... 179 helpful tips ............................................................... 178 resources................................................................. 178 t thermal operating conditions .......................................... 266 thermal packaging characteristics .................................. 266 third-party development tools ........................................ 264 timer1............................................................................... 133 control register ........................................................ 135 resources................................................................. 134 timer2/3............................................................................ 137 control registers ...................................................... 139 resources................................................................. 137 timing diagrams bor and master clear reset characteristics .......... 281 external clock .......................................................... 278 high-speed pwmx fault characteristics ................. 287 high-speed pwmx module characteristics ............. 287 i/o characteristics .................................................... 281 i2c1 bus data (master mode).................................. 300 i2c1 bus data (slave mode).................................... 302 i2c1 bus start/stop bits (master mode) .................. 300 i2c1 bus start/stop bits (slave mode) .................... 302 input capture 1 (ic1) characteristics ....................... 285 oc1/pwmx characteristics...................................... 286 output compare 1 (oc1) characteristics ................ 286 spi1 master mode (full-duplex, cke = 0, ckp = x, smp = 1) ........................................... 291 spi1 master mode (full-duplex, cke = 1, ckp = x, smp = 1) ........................................... 290 spi1 master mode (half-duplex, transmit only, cke = 0) .................................. 288 spi1 master mode (half-duplex, transmit only, cke = 1) .................................. 289 spi1 slave mode (full-duplex, cke = 0, ckp = 0, smp = 0) ........................................... 298 spi1 slave mode (full-duplex, cke = 0, ckp = 1, smp = 0) ........................................... 296 spi1 slave mode (full-duplex, cke = 1, ckp = 0, smp = 0) ........................................... 292 spi1 slave mode (full-duplex, cke = 1, ckp = 1, smp = 0) ........................................... 294 timer1-timer3 external clock characteristics ......... 283 uart1 i/o characteristics ....................................... 30 4 u unique device identifier (udid) ......................................... 27 universal asynchronous receiver transmitter (uart) .................................................. 193 control registers...................................................... 195 helpful tips............................................................... 194 resources ................................................................ 194 universal asynchronous receiver transmitter. see uart. v voltage regulator (on-chip) ......................................... ... 246 w watchdog timer (wdt)......................................... ... 239, 247 programming considerations ................................... 247 www address ................................................................. 338 www, on-line support ....... ................................................ 6 downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 338 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 339 dspic33epxxgs202 family the microchip web site microchip provides online support via our www site at www.microchip.com . this web site is used as a means to make files and information easily available to customers. accessible by using your favorite internet browser, the web site contains the following information: product support C data sheets and errata, application notes and sample programs, design resources, users guides and hardware support documents, latest software releases and archived software general technical support C frequently asked questions (faq), technical support requests, online discussion groups, microchip consultant program member listing business of microchip C product selector and ordering guides, latest microchip press releases, listing of seminars and events, listings of microchip sales offices, distributors and factory representatives customer change notification service microchips customer notification service helps keep customers current on microchip products. subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest. to register, access the microchip web site at www.microchip.com . under support, click on customer change notification and follow the registration instructions. customer support users of microchip products can receive assistance through several channels: distributor or representative local sales office field application engineer (fae) technical support customers should contact their distributor, representative or field application engineer (fae) for support. local sales offices are also available to help customers. a listing of sales offices and locations is included in the back of this document. technical support is available through the web site at: http://microchip.com/support downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 340 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 341 dspic33epxxgs202 family product identification system to order or obtain information, e.g., on pricing or de livery, refer to the factory or the listed sales office . microchip trademark architecture flash memory family program memory size (kbyte) product group pin count temperature range package pattern dspic 33 ep xx g s 2 02 t - i / p t x xx tape and reel flag (if applicable) architecture: 33 = 16-bit digital signal controller flash memory family: ep = enhanced performance product group: gs = smps family pin count: 02 = 28-pin temperature range: i=-40 ? c to +85 ? c (industrial) e=-40 ? c to +125 ? c (extended) package: mm = plastic quad, no lead package C (28-pin) 6x6 mm body (qfn-s) m6 = plastic quad flat, no lead package C (28-pin) 4x4x0.6 mm body (uqfn) mx = plastic quad flat, no lead package C (28-pin) 6x6x0.5 mm body (uqfn) so = plastic small outline, wide C (28-pin) 7.50 mm body (soic) ss = plastic shrink small outline C (28-pin) 5.30 mm body (ssop) examples: dspic33ep32gs202-i/ss: dspic33, enhanced performance, 32-kbyte program memory, smps, 28-pin, industrial temperature, ssop package. downloaded from: http:///
dspic33epxxgs202 family ds70005208d-page 342 ? 2015-2016 microchip technology inc. notes: downloaded from: http:///
? 2015-2016 microchip technology inc. ds70005208d-page 343 information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. microchip makes no representations or warranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip devices in life support and/or safety applications is entirely at the buyers risk, and the buyer agrees to defend, indemnify and hold harmless microchip from any and all damages, claims, suits, or expenses resulting from such use. no licenses are conveyed, implicitly or otherwise, under any microchip intellectual property rights unless otherwise stated. trademarks the microchip name and logo, the microchip logo, anyrate, dspic, flashflex, flexpwr, heldo, jukeblox, keeloq, keeloq logo, kleer, lancheck, link md, medialb, most, most logo, mplab, optolyzer, pic, picstart, pic32 logo, righttouch, spynic, sst, sst logo, superflash and uni/o are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. clockworks, the embedded control solutions company, ethersynch, hyper speed control, hyperlight load, intellimos, mtouch, precision edge, and quiet-wire are registered trademarks of micr ochip technology incorporated in the u.s.a. analog-for-the-digital age, any capacitor, anyin, anyout, bodycom, chipkit, chipkit logo, codeguard, dspicdem, dspicdem.net, dynamic average matching, dam, ecan, ethergreen, in-circuit serial programming, icsp, inter-chip connectivity, jitterblocker, kleernet, kleernet logo, miwi, motorbench, mpasm, mpf, mplab certified logo, mplib, mplink, multitrak, netdetach, omniscient code generation, picdem, picdem.net, pickit, pictail, puresilicon, righttouch logo, real ice, ripple blocker, serial quad i/o, sqi, superswitcher, superswitcher ii, total endurance, tsharc, usbcheck, varisense, viewspan, wiperlock, wireless dna, and zena are trademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of mi crochip technology incorporated in the u.s.a. silicon storage technology is a registered trademark of microchip technology inc. in other countries. gestic is a registered tradem arks of microchip technology germany ii gmbh & co. kg, a subsidiary of microchip technology inc., in other countries. all other trademarks mentioned herein are property of their respective companies. ? 2015-2016, microchip technology incorporated, printed in the u.s.a., all rights reserved. isbn: 978-1-5224-0578-8 note the following details of the code protection feature on microchip devices: microchip products meet the specification cont ained in their particular microchip data sheet. microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions. there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip produc ts in a manner outside the operating specif ications contained in microchips data sheets. most likely, the person doing so is engaged in theft of intellectual property. microchip is willing to work with the customer who is concerned about the integrity of their code. neither microchip nor any other semiconduc tor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as unbreakable. code protection is constantly evolving. we at microchip are co mmitted to continuously improvin g the code protection features of our products. attempts to break microchips code protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona; gresham, oregon and design centers in california and india. the company?s quality system processes and procedures are for its pic ? mcus and dspic ? dscs, k ee l oq ? code hopping devices, serial eeproms, microperipherals, nonvolatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified. quality management s ystem certified by dnv == iso/ts 16949 == downloaded from: http:///
ds70005208d-page 344 ? 2015-2016 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: http://www.microchip.com/ support web address: www.microchip.com atlanta duluth, ga tel: 678-957-9614 fax: 678-957-1455 austin, tx tel: 512-257-3370 boston westborough, ma tel: 774-760-0087 fax: 774-760-0088 chicago itasca, il tel: 630-285-0071 fax: 630-285-0075 cleveland independence, oh tel: 216-447-0464 fax: 216-447-0643 dallas addison, tx tel: 972-818-7423 fax: 972-818-2924 detroit novi, mi tel: 248-848-4000 houston, tx tel: 281-894-5983 indianapolis noblesville, in tel: 317-773-8323 fax: 317-773-5453 los angeles mission viejo, ca tel: 949-462-9523 fax: 949-462-9608 new york, ny tel: 631-435-6000 san jose, ca tel: 408-735-9110 canada - toronto tel: 905-673-0699 fax: 905-673-6509 asia/pacific asia pacific office suites 3707-14, 37th floor tower 6, the gateway harbour city, kowloon hong kong tel: 852-2943-5100 fax: 852-2401-3431 australia - sydney tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing tel: 86-10-8569-7000 fax: 86-10-8528-2104 china - chengdu tel: 86-28-8665-5511 fax: 86-28-8665-7889 china - chongqing tel: 86-23-8980-9588 fax: 86-23-8980-9500 china - dongguan tel: 86-769-8702-9880 china - hangzhou tel: 86-571-8792-8115 fax: 86-571-8792-8116 china - hong kong sar tel: 852-2943-5100 fax: 852-2401-3431 china - nanjing tel: 86-25-8473-2460 fax: 86-25-8473-2470 china - qingdao tel: 86-532-8502-7355 fax: 86-532-8502-7205 china - shanghai tel: 86-21-5407-5533 fax: 86-21-5407-5066 china - shenyang tel: 86-24-2334-2829 fax: 86-24-2334-2393 china - shenzhen tel: 86-755-8864-2200 fax: 86-755-8203-1760 china - wuhan tel: 86-27-5980-5300 fax: 86-27-5980-5118 china - xian tel: 86-29-8833-7252 fax: 86-29-8833-7256 asia/pacific china - xiamen tel: 86-592-2388138 fax: 86-592-2388130 china - zhuhai tel: 86-756-3210040 fax: 86-756-3210049 india - bangalore tel: 91-80-3090-4444 fax: 91-80-3090-4123 india - new delhi tel: 91-11-4160-8631 fax: 91-11-4160-8632 india - pune tel: 91-20-3019-1500 japan - osaka tel: 81-6-6152-7160 fax: 81-6-6152-9310 japan - tokyo tel: 81-3-6880- 3770 fax: 81-3-6880-3771 korea - daegu tel: 82-53-744-4301 fax: 82-53-744-4302 korea - seoul tel: 82-2-554-7200 fax: 82-2-558-5932 or 82-2-558-5934 malaysia - kuala lumpur tel: 60-3-6201-9857 fax: 60-3-6201-9859 malaysia - penang tel: 60-4-227-8870 fax: 60-4-227-4068 philippines - manila tel: 63-2-634-9065 fax: 63-2-634-9069 singapore tel: 65-6334-8870 fax: 65-6334-8850 taiwan - hsin chu tel: 886-3-5778-366 fax: 886-3-5770-955 taiwan - kaohsiung tel: 886-7-213-7828 taiwan - taipei tel: 886-2-2508-8600 fax: 886-2-2508-0102 thailand - bangkok tel: 66-2-694-1351 fax: 66-2-694-1350 europe austria - wels tel: 43-7242-2244-39 fax: 43-7242-2244-393 denmark - copenhagen tel: 45-4450-2828 fax: 45-4485-2829 france - paris tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany - dusseldorf tel: 49-2129-3766400 germany - karlsruhe tel: 49-721-625370 germany - munich tel: 49-89-627-144-0 fax: 49-89-627-144-44 italy - milan tel: 39-0331-742611 fax: 39-0331-466781 italy - venice tel: 39-049-7625286 netherlands - drunen tel: 31-416-690399 fax: 31-416-690340 poland - warsaw tel: 48-22-3325737 spain - madrid tel: 34-91-708-08-90 fax: 34-91-708-08-91 sweden - stockholm tel: 46-8-5090-4654 uk - wokingham tel: 44-118-921-5800 fax: 44-118-921-5820 worldwide sales and service 07/14/15 downloaded from: http:///


▲Up To Search▲   

 
Price & Availability of DSPIC33EP16GS202

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X